Jump to content

list team on client


kino

Recommended Posts

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

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

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