mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-28 15:02:12 +00:00
Fixed permission checks in certain commands
This commit is contained in:
parent
511b663f2a
commit
adb469a29f
4 changed files with 16 additions and 7 deletions
|
@ -60,13 +60,16 @@ function commandBan(clientId, command, victim, ...)
|
|||
elseif args[1] then
|
||||
duration = 600
|
||||
reason = table.concat(args, " ")
|
||||
elseif not auth.isPlayerAllowed(clientId, "8") then
|
||||
elseif auth.isPlayerAllowed(clientId, auth.PERM_PERMA) then
|
||||
duration = -1
|
||||
reason = "banned by admin"
|
||||
else
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dban usage: "..commands.getadmin("ban")["syntax"].."\";")
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if auth.isPlayerAllowed(cmdClient, "!") then
|
||||
if auth.isPlayerAllowed(cmdClient, auth.PERM_IMMUNE) then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dban: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is immune to this command.\";")
|
||||
|
||||
return true
|
||||
|
|
|
@ -47,7 +47,7 @@ function commandKick(clientId, command, victim, ...)
|
|||
return true
|
||||
end
|
||||
|
||||
if auth.isPlayerAllowed(cmdClient, "!") then
|
||||
if auth.isPlayerAllowed(cmdClient, auth.PERM_IMMUNE) then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dkick: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is immune to this command.\";")
|
||||
|
||||
return true
|
||||
|
|
|
@ -62,7 +62,10 @@ function commandMute(clientId, command, victim, ...)
|
|||
elseif args[1] then
|
||||
duration = 600
|
||||
reason = table.concat(args, " ")
|
||||
elseif not auth.isPlayerAllowed(clientId, "8") then
|
||||
elseif auth.isPlayerAllowed(clientId, auth.PERM_PERMA) then
|
||||
duration = -1
|
||||
reason = "muted by admin"
|
||||
else
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute usage: "..commands.getadmin("mute")["syntax"].."\";")
|
||||
|
||||
return true
|
||||
|
@ -72,7 +75,7 @@ function commandMute(clientId, command, victim, ...)
|
|||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is already muted.\";")
|
||||
|
||||
return true
|
||||
elseif auth.isPlayerAllowed(cmdClient, "!") then
|
||||
elseif auth.isPlayerAllowed(cmdClient, auth.PERM_IMMUNE) then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is immune to this command.\";")
|
||||
|
||||
return true
|
||||
|
|
|
@ -62,7 +62,10 @@ function commandVoiceMute(clientId, command, victim, ...)
|
|||
elseif args[1] then
|
||||
duration = 600
|
||||
reason = table.concat(args, " ")
|
||||
elseif not auth.isPlayerAllowed(clientId, "8") then
|
||||
elseif auth.isPlayerAllowed(clientId, auth.PERM_PERMA) then
|
||||
duration = -1
|
||||
reason = "muted by admin"
|
||||
else
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute usage: "..commands.getadmin("vmute")["syntax"].."\";")
|
||||
|
||||
return true
|
||||
|
@ -72,7 +75,7 @@ function commandVoiceMute(clientId, command, victim, ...)
|
|||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is already muted.\";")
|
||||
|
||||
return true
|
||||
elseif auth.isPlayerAllowed(cmdClient, "!") then
|
||||
elseif auth.isPlayerAllowed(cmdClient, auth.PERM_IMMUNE) then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is immune to this command.\";")
|
||||
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue