bamby12 Posted August 15, 2011 Share Posted August 15, 2011 Ok i made a GUI and put a gridlist in, i want the gridlist to show all the players from the players current team how would i go about this? Link to comment
Castillo Posted August 15, 2011 Share Posted August 15, 2011 for index, player in pairs(getElementsByType("player")) do local team = getPlayerTeam(player) if not team then teamName = "None" else teamName = getTeamName(team) end --gridlist rows should go here end Link to comment
Headshot4Fun Posted August 15, 2011 Share Posted August 15, 2011 Theres a wiki page about this function. You should lurk more bro. function clientsideResourceStart () x,y = guiGetScreenSize(getLocalPlayer()) -- get your screen size local col = guiCreateGridList ( x/2-200/2, y/2-400/2, 200, 400, false ) -- Creates the gridList local TeamName = "gaylords" -- Change this to the team name for i,v in ipairs(getElementsByType("player")) do -- Get all the server players if (getPlayerTeam(v) == TeamName) then -- Check id they are in that team... gaylords local row = guiGridListAddRow (col) -- Create the row guiGridListSetItemText ( playerList, row, col, getPlayerName (v), false, false ) -- Name the row as the player name end end end addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart ) -- When the res start he will create the window and add all players This should work. Else, post /debugscript and TRY TO STUDY THE SCRIPT, not just control C control V Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now