Jump to content

[solved] save Team


abu5lf

Recommended Posts

function onLogin (_,account) 
    local police = getAccountData(account, "polic") 
    if police then 
    setPlayerTeam ( source, police )     
    setElementModel (source, 230) 
    end 
end  
addEventHandler ("onPlayerLogin", root, onLogin) 
  
function saveData(thePlayer, theAccount) 
    if (getPlayerTeam(thePlayer) == getTeamFromName("Police")) and (theAccount and not isGuestAccount(theAccount)) then 
            setAccountData (theAccount, "police",  getTeamFromName("Police") ) 
    end 
end 
addEventHandler ("onPlayerQuit", root, saveData) 
addEventHandler ("onPlayerLogout", root, saveData) 

Edited by Guest
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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