dobrograd-13-06-2022/garrysmod/addons/feature-gmpanel/lua/gmpanel/actions/hunger/server.lua
Jonny_Bro (Nikita) e4d5311906 first commit
2023-11-16 15:01:19 +05:00

13 lines
460 B
Lua

gmpanel.registerAction('hunger', function(obj, ply)
local status, players = obj.value or nil
local players = gmpanel.buildTargets(obj.players or {})
for _,pl in ipairs(players) do
pl.hungerDisabled = status
end
ply:Notify('Изменение голода для игроков в группе ' .. (status and 'от' or 'в') .. 'ключено')
end)
hook.Add('hungerUpdate', 'gmpanel', function(ply)
if ply.hungerDisabled then return true end
end)