Jump to content

save team on server restart


5150

Recommended Posts

Here you go, i did this part for you it will get the player's team if the resource stopped , now you have to get the element data to your code

function saveTeam() 
    for index, vTeam in pairs(getElementsByType("player")) do 
        if (getPlayerTeam(vTeam)) then 
            local aTeam = getTeamName(getPlayerTeam(vTeam)) 
            setElementData(vTeam,"setTeam",tostring(aTeam)) 
        end 
    end 
end 
addEventHandler("onResourceStop", getRootElement(),saveTeam) 

Link to comment
  • 5 years later...
  • Administrators

As this thread is showing its age, I've applied a lock.

If you require any more help, please create a new thread so that you can get the custom help you need. :)

Link to comment
  • Tut locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...