Jump to content

gridList problem


SkatCh

Recommended Posts

Posted

hello community please can any one help me to fix this :

function addPlayersToGridlist() 
    if (not aColumn or isAdminBrowsing) then return end 
    guiGridListClear(aGrid1)     -- line 502 
    for index, players in pairs(getElementsByType("player")) do  
        local localTeam = getPlayerTeam(players) 
        if (localTeam) then 
            mainR, mainG, mainB = getTeamColor(localTeam) 
        else 
            mainR, mainG, mainB = 255, 255, 255 
        end 
        local row = guiGridListAddRow(aGrid1)  -- line 510 
        local name = getPlayerName(players) 
        guiGridListSetItemText(aGrid1, row, aColumn, name, false, false)  -- line 512 
        guiGridListSetItemColor(aGrid1, row, aColumn, mainR, mainG, mainB)  -- line 513 
        getPlayerRow[players] = row 
    end 
end 

warnings :

7502090fd8.jpg

Posted

Can't you see it? aGrid1 is nil... it's not defined, the gridlist wasn't created. Show us the code where you created it, it's possibly local variable.

Posted

i create it :

[lua]aGrid1 = guiCreateGridList(3,31,177,456,false,aTab1)

    aColumn = guiGridListAddColumn(aGrid1,"Players",0.8)

Posted
Can't you see it? aGrid1 is nil... it's not defined, the gridlist wasn't created. Show us the code where you created it, it's possibly local variable.

i add it to local variable :

local aWindow, aTab,aButton, aEdit,aColumn, aLabel,aGrid1 = {}, {}, {}, {}, {}, {} , {}, {}, {} ,{} 

and now i got this warning in the same lines but :

[expected gui-element at argument 1 , got table ]

Posted

i try it it , didn't work

Note : my Gui is working fine and i can see players inside the Gridlist but i don't know why i got this warning .

i'm sorry about my english .

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