kino Posted October 31, 2011 Share Posted October 31, 2011 Google Translate --- sorry me that I have created topic help me find the errors I created a matrix a part of code it work factions[i]={name,leader,fnum,spawnx,spawny,spawnz,rang1,rang2,rang3,rang4,rang5,skin1,skin2,skin3,skin4,skin5,ftype,fmoney,r,g,b} team[i]=createTeam(name,r,g,b) outputDebugString(tostring(factions[i][1]) .. "load") end error: [2011-11-01 01:30:26] WARNING: [gamemodes]/mode0/score.lua:270: Bad argument @ 'getAccountData' [Expected account at argument 1, got nil] [2011-11-01 01:30:26] ERROR: [gamemodes]/mode0/score.lua:272: attempt to index field '?' (a nil value) code line 263-283: addEventHandler("onPlayerLogin", root,function() if (not getAccountData(theCurrentAccount,"team")) then local team for i, v in ipairs(factions[i][1]) do team[i]=tostring(v) end triggerClientEvent ( source, "regt", getRootElement(), team )-- return 0 else spawnf(source,getAccountData(theCurrentAccount,"team")) outputDebugString (tostring( getAccountData(theCurrentAccount,"team"))) end end ) Link to comment
SDK Posted November 1, 2011 Share Posted November 1, 2011 https://wiki.multitheftauto.com/wiki/OnPlayerLogin You need to add the parameters to the function declaration. addEventHandler("onPlayerLogin", root, function(thePreviousAccount, theCurrentAccount) if ( not getAccountData(theCurrentAccount,"team") ) then local team for i, v in ipairs(factions[i][1]) do team[i]=tostring(v) end triggerClientEvent ( source, "regt", root, team ) return else spawnf ( source, getAccountData(theCurrentAccount,"team") ) outputDebugString ( tostring(getAccountData(theCurrentAccount,"team")) ) end end ) Link to comment
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