From 6eeec2d20aeb5a604ba7c2f881ae3aea2ecdfe4e Mon Sep 17 00:00:00 2001 From: Timo Smit Date: Tue, 21 Feb 2017 10:45:16 +0100 Subject: [PATCH] Fixed suspicious globals (fixes #75) --- luamods/wolfadmin/commands/admin/setlevel.lua | 2 ++ luamods/wolfadmin/commands/admin/warn.lua | 2 ++ 2 files changed, 4 insertions(+) diff --git a/luamods/wolfadmin/commands/admin/setlevel.lua b/luamods/wolfadmin/commands/admin/setlevel.lua index 79a4c2b..c6cbb37 100644 --- a/luamods/wolfadmin/commands/admin/setlevel.lua +++ b/luamods/wolfadmin/commands/admin/setlevel.lua @@ -57,6 +57,8 @@ end commands.addadmin("setlevel", commandSetLevel, auth.PERM_SETLEVEL, "sets the admin level of a player", "^9[^3name|slot#^9] ^9[^3level^9]", true, (settings.get("g_standalone") == 1)) function commandSetLevel(clientId, command, victim, level) + local cmdClient + if victim == nil then et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dsetlevel usage: "..commands.getadmin("setlevel")["syntax"].."\";") diff --git a/luamods/wolfadmin/commands/admin/warn.lua b/luamods/wolfadmin/commands/admin/warn.lua index 4b70d5d..c56055c 100644 --- a/luamods/wolfadmin/commands/admin/warn.lua +++ b/luamods/wolfadmin/commands/admin/warn.lua @@ -53,6 +53,8 @@ end commands.addadmin("warn", commandWarn, auth.PERM_WARN, "warns a player by displaying the reason", "^9[^3name|slot#^9] ^9[^3reason^9]", true, (settings.get("g_standalone") == 1 or settings.get("g_playerHistory") == 0)) function commandWarn(clientId, command, victim, ...) + local cmdClient + if not victim or not ... then et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dwarn usage: "..commands.getadmin("warn")["syntax"].."\";")