dobrograd-13-06-2022/garrysmod/gamemodes/darkrp/gamemode/modules/money/sh_money.lua
Jonny_Bro (Nikita) e4d5311906 first commit
2023-11-16 15:01:19 +05:00

10 lines
254 B
Lua

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