xyz Posted April 7, 2016 Share Posted April 7, 2016 So I'm nearly done with my saving system, but I can't save walking style, it wont work.. Link to comment
xyz Posted April 7, 2016 Author Share Posted April 7, 2016 So I'm nearly done with my saving system, but I can't save walking style, it wont work.. Link to comment
xyz Posted April 7, 2016 Author Share 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) Link to comment
xyz Posted April 7, 2016 Author Share 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) Link to comment
roaddog Posted April 7, 2016 Share 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. Link to comment
roaddog Posted April 7, 2016 Share 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. Link to comment
Anubhav Posted April 8, 2016 Share 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) Link to comment
Anubhav Posted April 8, 2016 Share 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) Link to comment
Walid Posted April 8, 2016 Share 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) Link to comment
Walid Posted April 8, 2016 Share 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) Link to comment
GTX Posted April 10, 2016 Share 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) Link to comment
KariiiM Posted April 10, 2016 Share 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 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