SkatCh Posted July 1, 2014 Posted July 1, 2014 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 :
MIKI785 Posted July 1, 2014 Posted July 1, 2014 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.
SkatCh Posted July 1, 2014 Author Posted July 1, 2014 i create it : [lua]aGrid1 = guiCreateGridList(3,31,177,456,false,aTab1) aColumn = guiGridListAddColumn(aGrid1,"Players",0.
xXMADEXx Posted July 1, 2014 Posted July 1, 2014 For whatever reason, the grid aGrid1 doesn't exist when the function addPlayersToGridlist ( ) is called... Post the entire code please.
SkatCh Posted July 1, 2014 Author Posted July 1, 2014 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 ]
MIKI785 Posted July 1, 2014 Posted July 1, 2014 Why the hell are you making it a table? Just wherever you are creating the aGrid1 don't make it local but make it as a global.
SkatCh Posted July 1, 2014 Author Posted July 1, 2014 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 .
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