can somebody please tell me how to save things like money im not asking anyone to script this for me i just want to know how to do it so i can save other things like the players skin and health i had a look an the mta wiki and found this:
---money
function onPlayerQuit ( )
-- when a player leaves, store his current money amount in his account data
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local playermoney = getPlayerMoney ( source )
setAccountData ( playeraccount, "money", playermoney )
end
end
function onPlayerlogin ( )
-- when a player joins, retrieve his money amount from his account data and set it
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local playermoney = getAccountData ( playeraccount, "money" )
-- make sure there was actually a value saved under this key (check if playermoney is not false).
-- this will for example not be the case when a player plays the gametype for the first time
if ( playermoney ) then
setPlayerMoney ( source, playermoney )
end
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerlogin", getRootElement ( ), onPlayerlogin )
i tried to edit it abit so it would work on login and not join but it dosent seem to work with join or login and im also using the logingui script if that will stop it but thanks anyway and also how will it know where to save it or will it automaticly save it to the accounts.xml??.