diff --git a/luascripts/wolfadmin/admin/admin.lua b/luascripts/wolfadmin/admin/admin.lua index 14e198a..dab9025 100644 --- a/luascripts/wolfadmin/admin/admin.lua +++ b/luascripts/wolfadmin/admin/admin.lua @@ -32,7 +32,7 @@ function admin.putPlayer(clientId, teamId) end function admin.kickPlayer(victimId, invokerId, reason) - et.trap_DropClient(victimId, "You have been kicked, Reason: "..(reason and reason or "kicked by admin"), 0) + et.trap_DropClient(victimId, "You have been kicked, Reason: "..reason, 0) end function admin.setPlayerLevel(clientId, level) diff --git a/luascripts/wolfadmin/commands/admin/ban.lua b/luascripts/wolfadmin/commands/admin/ban.lua index 43fc9b5..2723fd8 100644 --- a/luascripts/wolfadmin/commands/admin/ban.lua +++ b/luascripts/wolfadmin/commands/admin/ban.lua @@ -54,14 +54,13 @@ function commandBan(clientId, command, victim, ...) if args[1] and util.getTimeFromString(args[1]) and args[2] then duration = util.getTimeFromString(args[1]) reason = table.concat(args, " ", 2) - elseif args[1] and util.getTimeFromString(args[1]) then + elseif args[1] and util.getTimeFromString(args[1]) and auth.isPlayerAllowed(clientId, auth.PERM_NOREASON) then duration = util.getTimeFromString(args[1]) reason = "banned by admin" - elseif args[1] then + elseif args[1] and not util.getTimeFromString(args[1]) then duration = 600 reason = table.concat(args, " ") - elseif auth.isPlayerAllowed(clientId, auth.PERM_PERMA) then - duration = -1 + elseif auth.isPlayerAllowed(clientId, auth.PERM_PERMA) and auth.isPlayerAllowed(clientId, auth.PERM_NOREASON) then reason = "banned by admin" else et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dban usage: "..commands.getadmin("ban")["syntax"].."\";") @@ -85,7 +84,11 @@ function commandBan(clientId, command, victim, ...) history.add(cmdClient, clientId, "ban", reason) end - et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dban: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been banned for "..duration.." seconds\";") + if duration then + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dban: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been banned for "..duration.." seconds\";") + else + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dban: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been banned permanently\";") + end return true end diff --git a/luascripts/wolfadmin/commands/admin/kick.lua b/luascripts/wolfadmin/commands/admin/kick.lua index 78e609f..94a3736 100644 --- a/luascripts/wolfadmin/commands/admin/kick.lua +++ b/luascripts/wolfadmin/commands/admin/kick.lua @@ -57,7 +57,18 @@ function commandKick(clientId, command, victim, ...) return true end - local reason = table.concat({...}, " ") + local args = {...} + local reason + + if args[1] then + reason = table.concat(args, " ") + elseif auth.isPlayerAllowed(clientId, auth.PERM_NOREASON) then + reason = "kicked by admin" + else + et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dkick usage: "..commands.getadmin("kick")["syntax"].."\";") + + return true + end admin.kickPlayer(cmdClient, clientId, reason) diff --git a/luascripts/wolfadmin/commands/admin/mute.lua b/luascripts/wolfadmin/commands/admin/mute.lua index 65a32b4..255a3ec 100644 --- a/luascripts/wolfadmin/commands/admin/mute.lua +++ b/luascripts/wolfadmin/commands/admin/mute.lua @@ -56,14 +56,14 @@ function commandMute(clientId, command, victim, ...) if args[1] and util.getTimeFromString(args[1]) and args[2] then duration = util.getTimeFromString(args[1]) reason = table.concat(args, " ", 2) - elseif args[1] and util.getTimeFromString(args[1]) then + elseif args[1] and util.getTimeFromString(args[1]) and auth.isPlayerAllowed(clientId, auth.PERM_NOREASON) then duration = util.getTimeFromString(args[1]) reason = "muted by admin" - elseif args[1] then + elseif args[1] and not util.getTimeFromString(args[1]) then duration = 600 reason = table.concat(args, " ") - elseif auth.isPlayerAllowed(clientId, auth.PERM_PERMA) then - duration = -1 + elseif auth.isPlayerAllowed(clientId, auth.PERM_NOREASON) then + duration = 600 reason = "muted by admin" else et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute usage: "..commands.getadmin("mute")["syntax"].."\";") diff --git a/luascripts/wolfadmin/commands/admin/vmute.lua b/luascripts/wolfadmin/commands/admin/vmute.lua index 2e2e677..82d6075 100644 --- a/luascripts/wolfadmin/commands/admin/vmute.lua +++ b/luascripts/wolfadmin/commands/admin/vmute.lua @@ -52,22 +52,22 @@ function commandVoiceMute(clientId, command, victim, ...) local args = {...} local duration, reason - + if args[1] and util.getTimeFromString(args[1]) and args[2] then duration = util.getTimeFromString(args[1]) reason = table.concat(args, " ", 2) - elseif args[1] and util.getTimeFromString(args[1]) then + elseif args[1] and util.getTimeFromString(args[1]) and auth.isPlayerAllowed(clientId, auth.PERM_NOREASON) then duration = util.getTimeFromString(args[1]) reason = "muted by admin" - elseif args[1] then + elseif args[1] and not util.getTimeFromString(args[1]) then duration = 600 reason = table.concat(args, " ") - elseif auth.isPlayerAllowed(clientId, auth.PERM_PERMA) then - duration = -1 + elseif auth.isPlayerAllowed(clientId, auth.PERM_NOREASON) then + duration = 600 reason = "muted by admin" else et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute usage: "..commands.getadmin("vmute")["syntax"].."\";") - + return true end