function onLeave (thePlayer)
local level = getPlayerWantedLevel(thePlayer)
if isGuestAccount then return end
local account = getPlayerAccount(thePlayer)
setAccountData(account,"wanted",level)
end
addEventHandler("onPlayerQuit",root,onLeave)
function onLogin (thePlayer)
local account = getPlayerAccount
local level = getAccountData(account,"wanted")
setPlayerWantedLevel(thePlayer,level)
end
addEventHandler("onPlayerLogin",root,onLogin)