xyz Posted April 7, 2016 Posted April 7, 2016 So I'm nearly done with my saving system, but I can't save walking style, it wont work..
xyz Posted April 7, 2016 Author Posted April 7, 2016 So I'm nearly done with my saving system, but I can't save walking style, it wont work..
xyz Posted April 7, 2016 Author Posted April 7, 2016 function onQuit()local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", walk) endendaddEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc)local walk = getAccountData(acc, "wstyle") setPedWalkingStyle(source, walk)endaddEventHandler("onPlayerLogin", getRootElement(), onLogin)
xyz Posted April 7, 2016 Author Posted April 7, 2016 function onQuit() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", walk) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") setPedWalkingStyle(source, walk) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
roaddog Posted April 7, 2016 Posted April 7, 2016 function onQuit() if isElement(source) then local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", walk) end end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) Try it.
roaddog Posted April 7, 2016 Posted April 7, 2016 function onQuit() if isElement(source) then local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", walk) end end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) Try it.
Anubhav Posted April 8, 2016 Posted April 8, 2016 function onQuit() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", tostring(walk)) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 setPedWalkingStyle(source, tonumber(walk)) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
Anubhav Posted April 8, 2016 Posted April 8, 2016 function onQuit() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", tostring(walk)) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 setPedWalkingStyle(source, tonumber(walk)) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
Walid Posted April 8, 2016 Posted April 8, 2016 function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 if walk then setPedWalkingStyle(source, tonumber(walk)) end end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
Walid Posted April 8, 2016 Posted April 8, 2016 function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 if walk then setPedWalkingStyle(source, tonumber(walk)) end end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
GTX Posted April 10, 2016 Posted April 10, 2016 Any errors in debugscript? Is the script server sided? Try: function onQuit() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", tonumber(walk)) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 setPedWalkingStyle(source, tonumber(walk)) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
KariiiM Posted April 10, 2016 Posted April 10, 2016 GTX's code seem working fine, just be sure you have declared your file as server sided in your meta xml
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