dobrograd-13-06-2022/garrysmod/gamemodes/darkrp/gamemode/modules/money/sh_money.lua

11 lines
254 B
Lua
Raw Normal View History

2023-11-16 15:01:19 +05:00
local pMeta = FindMetaTable("Player")
function pMeta:canAfford(amount)
if not amount or amount < 0 then return false end
local curMoney = self:GetNetVar("money") or 0
if curMoney < 0 then return false end
return curMoney >= math.floor(amount)
end