Files
wnsrc/lua/arccw/server/sv_convar.lua
lifestorm 9c918c46e5 Upload
2024-08-04 23:12:27 +03:00

40 lines
1007 B
Lua

--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
if CLIENT then return end
net.Receive("arccw_sendconvar", function(len, ply)
local command = net.ReadString()
if !ply:IsAdmin() then return end
if game.SinglePlayer() then return end
if string.sub(command, 1, 5) != "arccw" then return end
local cmds = string.Split(command, " ")
local timername = "change" .. cmds[1]
if timer.Exists(timername) then
timer.Remove(timername)
end
local args = {}
for i, k in pairs(cmds) do
if k == " " then continue end
k = string.Trim(k, " ")
table.insert(args, k)
end
timer.Create(timername, 0.25, 1, function()
RunConsoleCommand(args[1], args[2])
print("Changed " .. args[1] .. " to " .. args[2] .. ".")
end)
end)