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

26 lines
822 B
Lua

/*---------------------------------------------------------
Database initialize
---------------------------------------------------------*/
function DarkRP.initDatabase()
hook.Call('DarkRPDBInitialized') -- we don't need anything from DarkRP anymore, hurray
end
/*---------------------------------------------------------
Players
---------------------------------------------------------*/
local ply = FindMetaTable 'Player'
function ply:Salary()
return self:GetNetVar('salary', GAMEMODE.Config.normalsalary)
end
function ply:SetSalary(amount)
if not amount then
return self:SetLocalVar('salary', nil)
end
amount = tonumber(amount)
if not amount or amount < 0 then return end
if amount == GAMEMODE.Config.normalsalary then
self:SetLocalVar('salary', nil)
else
self:SetLocalVar('salary', amount)
end
end