[CODE]
local meta = FindMetaTable("Player") --Get the meta table of player
function meta:AddMoney(amount)
local current_cash = self:GetMoney()
self:SetMoney( current_cash + amount )
end
function meta:SetMoney(amount)
self:SetNetworkedInt( "Money", amount )
self:SaveMoneyTXT()
end
function meta:SaveMoney()
local cash = self:GetMoney()
self:SetPData("money", cash)
end
function meta:SaveMoneyTXT()
file.Write(gmod.GetGamemode().Name .."/Money/".. string.gsub(self:SteamID(), ":", "_") ..".txt", self:GetMoneyString())
end
function meta:TakeMoney(amount)
--Add money function here
self:AddMoney(-amount)
end
function meta:GetMoney()
return self:GetNetworkedInt( "Money" )
end
[/CODE]
what are asking you
I think he's asking how does he change his money system to use MySQL instead of PData.
yes thats what i mean
[editline]25th July 2014[/editline]
what i mean is i want it so it will save my cash with txt or mysql
Sorry, you need to Log In to post a reply to this thread.