mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-21 20:01:18 +00:00
Fixed suspicious globals (fixes #75)
This commit is contained in:
parent
a72f15b058
commit
2c32671304
18 changed files with 36 additions and 0 deletions
|
@ -26,6 +26,8 @@ local util = require (wolfa_getLuaPath()..".util.util")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandBan(clientId, command, victim, ...)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dban usage: "..commands.getadmin("ban")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandFinger(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dfinger usage: "..commands.getadmin("finger")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandGib(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dgib usage: "..commands.getadmin("gib")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandKick(clientId, command, victim, ...)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dkick usage: "..commands.getadmin("kick")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ local pagination = require (wolfa_getLuaPath()..".util.pagination")
|
|||
local util = require (wolfa_getLuaPath()..".util.util")
|
||||
|
||||
function commandListAliases(clientId, command, victim, offset)
|
||||
local cmdClient
|
||||
|
||||
if not db.isconnected() then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistaliases: ^9alias history is disabled.\";")
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ local settings = require (wolfa_getLuaPath()..".util.settings")
|
|||
local util = require (wolfa_getLuaPath()..".util.util")
|
||||
|
||||
function commandListLevels(clientId, command, victim, offset)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
if settings.get("g_standalone") ~= 0 then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistlevels usage: "..commands.getadmin("listlevels")["syntax"].."\";")
|
||||
|
|
|
@ -28,6 +28,8 @@ local util = require (wolfa_getLuaPath()..".util.util")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandMute(clientId, command, victim, ...)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute usage: "..commands.getadmin("mute")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
|
|||
local players = require (wolfa_getLuaPath()..".players.players")
|
||||
|
||||
function commandPlayerLock(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dplock usage: "..commands.getadmin("plock")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
|
|||
local players = require (wolfa_getLuaPath()..".players.players")
|
||||
|
||||
function commandPlayerUnlock(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dpunlock usage: "..commands.getadmin("punlock")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ local constants = require (wolfa_getLuaPath()..".util.constants")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandPlayerLock(clientId, command, victim, team)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil or team == nil or (team ~= constants.TEAM_AXIS_SC and team ~= constants.TEAM_ALLIES_SC and team ~= constants.TEAM_SPECTATORS_SC) then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dput usage: "..commands.getadmin("put")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandSetLevel(clientId, command, victim, level)
|
||||
local cmdClient
|
||||
|
||||
if not victim or not level then
|
||||
return false
|
||||
elseif tonumber(victim) == nil or tonumber(victim) < 0 or tonumber(victim) > tonumber(et.trap_Cvar_Get("sv_maxclients")) then
|
||||
|
|
|
@ -28,6 +28,8 @@ local pagination = require (wolfa_getLuaPath()..".util.pagination")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandListHistory(clientId, command, victim, offset)
|
||||
local cmdClient
|
||||
|
||||
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dshowhistory: ^9player history is disabled.\";")
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandSlap(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dslap usage: "..commands.getadmin("slap")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
|
|||
local util = require (wolfa_getLuaPath()..".util.util")
|
||||
|
||||
function commandShowStats(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dstats usage: "..commands.getadmin("stats")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandUnmute(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dunmute usage: "..commands.getadmin("unmute")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
|
|||
local util = require (wolfa_getLuaPath()..".util.util")
|
||||
|
||||
function commandVoiceMute(clientId, command, victim, ...)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute usage: "..commands.getadmin("vmute")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
|
|||
local players = require (wolfa_getLuaPath()..".players.players")
|
||||
|
||||
function commandVoiceUnmute(clientId, command, victim)
|
||||
local cmdClient
|
||||
|
||||
if victim == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvunmute usage: "..commands.getadmin("vunmute")["syntax"].."\";")
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
|
|||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
function commandWarn(clientId, command, victim, ...)
|
||||
local cmdClient
|
||||
|
||||
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
|
||||
return false
|
||||
elseif not victim or not ... then
|
||||
|
|
Loading…
Reference in a new issue