UnKnownGuy Posted October 24, 2016 Share Posted October 24, 2016 Hello. Guys I am using Gym From NG and its not saving in account so i tried to fix it but i failed so i wanna know how to save the walking style in my account its named (NGGym) Link to comment
Walid Posted October 24, 2016 Share Posted October 24, 2016 function saveWalkStyle() local acc = getPlayerAccount(source) if acc and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "walkStyle", tonumber(walk)) end end addEventHandler("onPlayerQuit", root, saveWalkStyle) function loadWalkStyle(_, acc) local walk = getAccountData(acc, "wstyle") or 0 setPedWalkingStyle(source, tonumber(walk)) end addEventHandler("onPlayerLogin", root, loadWalkStyle) Link to comment
Swagy Posted October 24, 2016 Share Posted October 24, 2016 You can also use SQL database. Link to comment
UnKnownGuy Posted October 25, 2016 Author Share Posted October 25, 2016 14 hours ago, Walid said: function saveWalkStyle() local acc = getPlayerAccount(source) if acc and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "walkStyle", tonumber(walk)) end end addEventHandler("onPlayerQuit", root, saveWalkStyle) function loadWalkStyle(_, acc) local walk = getAccountData(acc, "wstyle") or 0 setPedWalkingStyle(source, tonumber(walk)) end addEventHandler("onPlayerLogin", root, loadWalkStyle) I'll use this in client.lua or server.lua? Link to comment
iPrestege Posted October 25, 2016 Share Posted October 25, 2016 25 minutes ago, UnKnownGuy said: I'll use this in client.lua or server.lua? It's server side you at least open the functions and you will know that even if you know the events you will know it's a SERVER SIDE CODE. 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