hi some time ago castillo give a script that saves team why it no work? he said he have no time to test.
function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)
if not (isGuestAccount (getPlayerAccount (source))) then
local accountData = getAccountData (theCurrentAccount, "team")
if (accountData) then
setPlayerTeam(source,accountData)
end
end
end
addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)
function onQuit (quitType, reason, responsibleElement,thePreviousAccount)
if not (isGuestAccount (getPlayerAccount (source))) then
account = getPlayerAccount (source)
if (account) then
local team = getPlayerTeam(source)
local teamname = getTeamName(team)
setAccountData (account, "team", teamname)
end
end
end
addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
function onLogout(prevAccount)
if not (isGuestAccount (getPlayerAccount (source))) then
account = getPlayerAccount (source)
if (account) then
local team = getPlayerTeam(source)
local teamname = getTeamName(team)
setAccountData (account, "team", teamname)
end
end
end
addEventHandler("onPlayerLogout", getRootElement(), onLogout)