Tete omar Posted July 24, 2012 Share Posted July 24, 2012 Hi all, is there any function that saves the player's position and money ? 1 Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 No, you can save them via account data ( easier way ). setAccountData Link to comment
TAPL Posted July 24, 2012 Share Posted July 24, 2012 addEventHandler("onPlayerQuit",root, function() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local x,y,z = getElementPosition(source) local money = getPlayerMoney(source) setAccountData(acc,"PosX",x) setAccountData(acc,"PosY",y) setAccountData(acc,"PosZ",z) setAccountData(acc,"Money",money) end end) addEventHandler("onPlayerLogin",root, function(_,acc) local x,y,z = getAccountData(acc,"PosX"),getAccountData(acc,"PosY"),getAccountData(acc,"PosZ") local Money = getAccountData(acc,"Money") or 0 setPlayerMoney(source,Money) spawnPlayer(source,x,y,z) fadeCamera(source, true) setCameraTarget(source) end 2 Link to comment
Kenix Posted July 24, 2012 Share Posted July 24, 2012 https://community.multitheftauto.com/index.php?p= ... ils&id=977 Link to comment
Tete omar Posted July 24, 2012 Author Share Posted July 24, 2012 thanks castillo thanks tapl thanks kenix 1 Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 thanks castillo thanks tapl thanks kenix You're welcome. 1 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