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 : Failure is simply an opportunity to begin again more intelligently - Henry Ford
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. Lua Scripter Owner of mshost.cz MTA portal.
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. Failure is simply an opportunity to begin again more intelligently - Henry Ford
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. The Ultimate Lua Tutorial! | MTA PHP SDK
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 ] Failure is simply an opportunity to begin again more intelligently - Henry Ford
SkatCh Posted July 1, 2014 Author Posted July 1, 2014 can anyone help me . Failure is simply an opportunity to begin again more intelligently - Henry Ford
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. Lua Scripter Owner of mshost.cz MTA portal.
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 . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Castillo Posted July 1, 2014 Posted July 1, 2014 Post the entire code. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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