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

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You could search the forums, it has been done before.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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