Jump to content

Save


UnKnownGuy

Recommended Posts

Posted

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)

Posted
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) 

 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
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?

Posted
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.

  

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...