iMr.3a[Z]eF Posted November 5, 2013 Share Posted November 5, 2013 What is wrong with this code? function Send() guiGridListSetSelectionMode(GUIEditor_Grid[1], 2) local cl = guiGridListAddColumn(GUIEditor_Grid[1], "Players List ...", 0.88) for _,name in ipairs(getElementsByType("player")) do local rw = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], rw, cl, getPlayerName(name), false, false) guiGridListSetItemColor ( GUIEditor_Grid[1], rw, cl, math.random(0,255), math.random(0,255), math.random(0,255) ) end end addEventHandler( "onClientPlayerJoin", root, function () for _,name in ipairs(getElementsByType("player")) do local rw = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], rw, cl, getPlayerName(name), false, false) guiGridListSetItemColor ( GUIEditor_Grid[1], rw, cl, math.random(0,255), math.random(0,255), math.random(0,255) ) end end ) addEventHandler( "onClientResourceStart", root, Send) addEventHandler( "onClientPlayerQuit", root, guiGridListRemoveRow ( GUIEditor_Grid[1], rw )) Link to comment
pa3ck Posted November 5, 2013 Share Posted November 5, 2013 Is it the whole thing? Because I cant see where you create the grid list. Link to comment
iMr.3a[Z]eF Posted November 5, 2013 Author Share Posted November 5, 2013 I created it. I only want when the player quit, the gridlist will remove his nickname from the gridlist. No need to Give you the whole codes. Link to comment
Castillo Posted November 5, 2013 Share Posted November 5, 2013 "rw" is not defined at the function executed by "onClientPlayerQuit". You'll have to either make a table which will store the grid list rows using the player element as index, or loop every single row and check if the name matches the player that quited. Link to comment
iMr.3a[Z]eF Posted November 5, 2013 Author Share Posted November 5, 2013 Could you do this for me. Because I'm really tired for finding solution Link to comment
Castillo Posted November 5, 2013 Share Posted November 5, 2013 You could search the forums, it has been done before. 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