HunT Posted September 12, 2011 Posted September 12, 2011 i Look in "C-panel By Castillo" For Example gridList And in my local host work. But in server show one player (show only the name from last player enter in server ) WHY?? clientSide Part : driversList = guiCreateGridList(28,85,146,149,false,bigWindow) local column = guiGridListAddColumn(driversList, "Drivers", 0.85) local row = guiGridListAddRow ( driversList ) if (column) then for id, playeritem in ipairs(getElementsByType("player")) do guiGridListSetItemText(driversList, row, column, getPlayerName(playeritem), false, false) end end guiGridListSetItemColor ( driversList, row, column, 255, 150, 0 ) guiGridListSetScrollBars ( driversList, true, true ) And in "onClientGUIClick" : if (source == botton1) then selectedPlayer = guiGridListGetItemText ( driversList, guiGridListGetSelectedItem (driversList), 1 ) if ( guiGridListGetSelectedItem ( driversList ) ~= -1 ) then triggerServerEvent ("pushim", getLocalPlayer()) else outputChatBox("No user selected -.-'", nil , 255, 0, 0, false) end Idk . . . help please.
JR10 Posted September 12, 2011 Posted September 12, 2011 You are not adding any rows. You are just setting the text. driversList = guiCreateGridList(28,85,146,149,false,bigWindow) local column = guiGridListAddColumn(driversList, "Drivers", 0.85) if (column) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( driversList ) guiGridListSetItemText(driversList, row, column, getPlayerName(playeritem), false, false) end end guiGridListSetItemColor ( driversList, row, column, 255, 150, 0 ) guiGridListSetScrollBars ( driversList, true, true ) And if you are updating later use, guiGridListClear it will clear all rows.
HunT Posted September 12, 2011 Author Posted September 12, 2011 setTimer ( guiGridListClear, 5000, 1, drivertList ) Ok edit and add this. Test and reply Tnx.
JR10 Posted September 12, 2011 Posted September 12, 2011 guiGridListClear clears (deletes) all the rows in the grid list. So it won't magically update the grid list alone. You must loop through it again, which is not necessary. Just onClientResourceStart, loop through players, and add them. And onJoin, add him. onQuit you can use this function: function guiGridListRemoveRowByName ( gridlist , column , name ) for index = 1 , guiGridListGetRowCount ( gridlist ) do if guiGridListGetItemText ( gridlist , index , column ) == name then guiGridListRemoveRow ( gridlist , index ) break end end end
HunT Posted September 12, 2011 Author Posted September 12, 2011 Ok Tnx work . .have only the miniBugs but is ok now. Tnx The Rock
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