dobrograd-13-06-2022/garrysmod/addons/admin-sg/lua/plugins/octostuff/init.lua
Jonny_Bro (Nikita) e4d5311906 first commit
2023-11-16 15:01:19 +05:00

34 lines
896 B
Lua

local plugin = plugin
plugin:IncludeFile('shared.lua', SERVERGUARD.STATE.SHARED)
concommand.Add('sgs', function(pPlayer, command, arguments)
if (arguments and arguments[1]) then
local commandName = string.lower(arguments[1]);
if commandName == 'cloak' or commandName == 'invisible' then
if IsValid(pPlayer) then pPlayer:Say('/invisible') end
return
end
local commandTable = serverguard.command:FindByID(commandName);
table.remove(arguments, 1);
if (commandTable) then
serverguard.command.Run(pPlayer, commandTable.command, true, unpack(arguments));
end;
end;
end);
hook.Add('PlayerSwitchWeapon', 'sg-compat', function(ply)
if ply:GetNoDraw() then
timer.Simple(0, function()
ply:DrawWorldModel(false)
end)
end
end)
hook.Add('octolib.event:sg', 'sg-compat', function(data)
octolib.msg('DB ServerGuard command:')
RunConsoleCommand('sg', unpack(data))
end)