Markn1 Posted September 13, 2017 Posted September 13, 2017 Does not save! Debug: no errors. Help pls --server function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local wpn1 = getAccountData (theCurrentAccount, "ak47") setPedStat (source, wpn1, 77) end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "ak47", getPedStat (source, 77)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
iMr.WiFi..! Posted September 13, 2017 Posted September 13, 2017 4 minutes ago, Markn1 said: Does not save! Debug: no errors. Help pls --server function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local wpn1 = getAccountData (theCurrentAccount, "ak47") setPedStat (source, wpn1, 77) end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "ak47", getPedStat (source, 77)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) If your not arabic please post your topic on this section :https://forum.multitheftauto.com/forum/71-scripting/ + Did you add mod on admin group ? Try it : function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then return end local wpn1 = getAccountData (theCurrentAccount, "ak47") setPedStat (source, wpn1, 77) end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then return end account = getPlayerAccount (source) if (account) then setAccountData (account, "ak47", getPedStat (source, 77)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
Markn1 Posted September 13, 2017 Author Posted September 13, 2017 2 minutes ago, iMr.WiFi..! said: If your not arabic please post your topic on this section : You are the most active here! My country is silent -- Tried, does not save.
iMr.WiFi..! Posted September 13, 2017 Posted September 13, 2017 5 minutes ago, iMr.WiFi..! said: Did you add resource on admin group ?
Markn1 Posted September 13, 2017 Author Posted September 13, 2017 1 minute ago, iMr.WiFi..! said: Did you add resource on admin group ? yes. no save
iMr.WiFi..! Posted September 13, 2017 Posted September 13, 2017 Just now, Markn1 said: yes. no save Try to change accontData name .. to "ak_74_stat" ex
Rockyz Posted September 13, 2017 Posted September 13, 2017 (edited) try this : function playerLogin ( thePreviousAccount, theCurrentAccount, autoLogin ) if ( getAccountData ( theCurrentAccount, 'ak74-DATA' ) ) then setPedStat ( source, getAccountData ( theCurrentAccount, 'ak74-DATA' ), 77 ) end end addEventHandler ( 'onPlayerLogin', root, playerLogin ) function playerLogOut ( prev, cur ) setAccountData ( prev, 'ak74-DATA', getPedStat ( source, 77 ) ) end addEventHandler ( 'onPlayerLogout', root, playerLogOut ) function onQuit ( quitType, reason, responsibleElement ) local acc = getPlayerAccount ( source ) if not ( isGuestAccount ( acc ) ) then setAccountData ( acc, 'ak74-DATA', getPedStat ( source, 77 ) ) end end addEventHandler ( 'onPlayerQuit', root, onQuit ) Edited September 13, 2017 by #,+( _xiRoc[K]; >
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