mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2025-02-16 17:01:48 +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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandBan(clientId, command, victim, ...)
|
function commandBan(clientId, command, victim, ...)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dban usage: "..commands.getadmin("ban")["syntax"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandFinger(clientId, command, victim)
|
function commandFinger(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dfinger usage: "..commands.getadmin("finger")["syntax"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandGib(clientId, command, victim)
|
function commandGib(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dgib usage: "..commands.getadmin("gib")["syntax"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandKick(clientId, command, victim, ...)
|
function commandKick(clientId, command, victim, ...)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dkick usage: "..commands.getadmin("kick")["syntax"].."\";")
|
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")
|
local util = require (wolfa_getLuaPath()..".util.util")
|
||||||
|
|
||||||
function commandListAliases(clientId, command, victim, offset)
|
function commandListAliases(clientId, command, victim, offset)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if not db.isconnected() then
|
if not db.isconnected() then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistaliases: ^9alias history is disabled.\";")
|
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")
|
local util = require (wolfa_getLuaPath()..".util.util")
|
||||||
|
|
||||||
function commandListLevels(clientId, command, victim, offset)
|
function commandListLevels(clientId, command, victim, offset)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
if settings.get("g_standalone") ~= 0 then
|
if settings.get("g_standalone") ~= 0 then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistlevels usage: "..commands.getadmin("listlevels")["syntax"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandMute(clientId, command, victim, ...)
|
function commandMute(clientId, command, victim, ...)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute usage: "..commands.getadmin("mute")["syntax"].."\";")
|
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")
|
local players = require (wolfa_getLuaPath()..".players.players")
|
||||||
|
|
||||||
function commandPlayerLock(clientId, command, victim)
|
function commandPlayerLock(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dplock usage: "..commands.getadmin("plock")["syntax"].."\";")
|
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")
|
local players = require (wolfa_getLuaPath()..".players.players")
|
||||||
|
|
||||||
function commandPlayerUnlock(clientId, command, victim)
|
function commandPlayerUnlock(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dpunlock usage: "..commands.getadmin("punlock")["syntax"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandPlayerLock(clientId, command, victim, team)
|
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
|
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"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandSetLevel(clientId, command, victim, level)
|
function commandSetLevel(clientId, command, victim, level)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if not victim or not level then
|
if not victim or not level then
|
||||||
return false
|
return false
|
||||||
elseif tonumber(victim) == nil or tonumber(victim) < 0 or tonumber(victim) > tonumber(et.trap_Cvar_Get("sv_maxclients")) then
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandListHistory(clientId, command, victim, offset)
|
function commandListHistory(clientId, command, victim, offset)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
|
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dshowhistory: ^9player history is disabled.\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandSlap(clientId, command, victim)
|
function commandSlap(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dslap usage: "..commands.getadmin("slap")["syntax"].."\";")
|
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")
|
local util = require (wolfa_getLuaPath()..".util.util")
|
||||||
|
|
||||||
function commandShowStats(clientId, command, victim)
|
function commandShowStats(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dstats usage: "..commands.getadmin("stats")["syntax"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandUnmute(clientId, command, victim)
|
function commandUnmute(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dunmute usage: "..commands.getadmin("unmute")["syntax"].."\";")
|
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")
|
local util = require (wolfa_getLuaPath()..".util.util")
|
||||||
|
|
||||||
function commandVoiceMute(clientId, command, victim, ...)
|
function commandVoiceMute(clientId, command, victim, ...)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute usage: "..commands.getadmin("vmute")["syntax"].."\";")
|
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")
|
local players = require (wolfa_getLuaPath()..".players.players")
|
||||||
|
|
||||||
function commandVoiceUnmute(clientId, command, victim)
|
function commandVoiceUnmute(clientId, command, victim)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if victim == nil then
|
if victim == nil then
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvunmute usage: "..commands.getadmin("vunmute")["syntax"].."\";")
|
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")
|
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||||
|
|
||||||
function commandWarn(clientId, command, victim, ...)
|
function commandWarn(clientId, command, victim, ...)
|
||||||
|
local cmdClient
|
||||||
|
|
||||||
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
|
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
|
||||||
return false
|
return false
|
||||||
elseif not victim or not ... then
|
elseif not victim or not ... then
|
||||||
|
|
Loading…
Reference in a new issue