SoManyTears Posted March 26, 2020 Share Posted March 26, 2020 I want to save the player wanted level, but it doesn't work.can someone help me ? thanks. function onQuit() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then local wantedLevel = getPlayerWantedLevel (source) setAccountData(acc, "wlevel", wantedLevel) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local acc = getPlayerAccount(source) local wantedLevel = getAccountData(acc, "wlevel") setTimer (setPlayerWantedLevel,500,1,acc,wantedLevel) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) Link to comment
Addlibs Posted March 26, 2020 Share Posted March 26, 2020 Easy mistake. You're applying the wanted level to the wrong element (to the account instead of the player) Line 13 should be setTimer (setPlayerWantedLevel,500,1,source,wantedLevel) 1 Link to comment
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