Jump to content

Can't getPlayerTeam on spawn


FWCentral

Recommended Posts

  • 1 month later...

-- server side:

addEventHandler("onPlayerWasted",root, 
function () 
    local team = getPlayerTeam(source) 
    if (team) then 
        setElementData(source,"tempTeam",getTeamName(team)) 
    end 
end) 
  
addEventHandler("onPlayerSpawn",root, 
function () 
    local team = getElementData(source,"tempTeam") 
    if (team and getTeamFromName(team)) then 
        setPlayerTeam(source,getTeamFromName(team)) 
    end 
end) 

That script should save the team on wasted and load it on spawn.

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