Jump to content

Lil problemeo


iMr.3a[Z]eF

Recommended Posts

Posted

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 )) 

Posted

"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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...