mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
40
lua/arccw/server/sv_convar.lua
Normal file
40
lua/arccw/server/sv_convar.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
--[[
|
||||
| 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)
|
||||
Reference in New Issue
Block a user