Chaz-CR Posted March 20, 2014 Posted March 20, 2014 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) ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
DNL291 Posted March 20, 2014 Posted March 20, 2014 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.
Chaz-CR Posted March 22, 2014 Author Posted March 22, 2014 I didn't understand. ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
Reggae Posted March 22, 2014 Posted March 22, 2014 Use in your script: setPlayerTeam ( source, nil ) removing it for the team, and after use SetAccountData to save.
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