Jump to content

A little help of a save system!


Chaz-CR

Recommended Posts

Posted

Hello guys, i was trying to make a save system of the teams, and it works BUT when i remove a player of a team and he leaves from the server, when he login again he's still in the team i removed before he quit. Any help?

function setTeam() 
local account = getPlayerAccount(source) 
local team = getAccountData (account, "team")  
if (team) and getTeamFromName(team) then 
      setPlayerTeam(source, getTeamFromName(team)) 
     end 
end 
addEventHandler("onPlayerLogin",root,setTeam)  
  
function save() 
 local team = getPlayerTeam(source) 
local account = getPlayerAccount(source) 
if (team) and not isGuestAccount(account) then  
setAccountData(account, "team", getTeamName(team)) 
 end 
    end 
addEventHandler("onPlayerQuit", getRootElement(), save) 

430x73_338AC4_FFFFFF_000000_000000.png

||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons||

http://facebook.com/AoBMTA - Fanpage

Posted

When you remove a player from the team, use setAccountData and remove the old player team from his account.

Please do not PM me with scripting related question nor support, use the forums instead.

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