Fixed possibility to slap/gib players not playing or alive

This commit is contained in:
Timo Smit 2017-03-13 18:24:04 +01:00
parent d31c6ff0a0
commit 0a230d592d
2 changed files with 18 additions and 0 deletions

View file

@ -21,6 +21,7 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require (wolfa_getLuaPath()..".players.players")
local constants = require (wolfa_getLuaPath()..".util.constants")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandGib(clientId, command, victim)
@ -53,6 +54,14 @@ function commandGib(clientId, command, victim)
elseif auth.getPlayerLevel(cmdClient) > auth.getPlayerLevel(clientId) then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dgib: ^9sorry, but your intended victim has a higher admin level than you do.\";")
return true
elseif et.gentity_get(cmdClient, "sess.sessionTeam") ~= constants.TEAM_AXIS and et.gentity_get(cmdClient, "sess.sessionTeam") ~= constants.TEAM_ALLIES then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dgib: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is not playing.\";")
return true
elseif et.gentity_get(cmdClient, "health") <= 0 then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dgib: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is not alive.\";")
return true
end

View file

@ -21,6 +21,7 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require (wolfa_getLuaPath()..".players.players")
local constants = require (wolfa_getLuaPath()..".util.constants")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandSlap(clientId, command, victim)
@ -53,6 +54,14 @@ function commandSlap(clientId, command, victim)
elseif auth.getPlayerLevel(cmdClient) > auth.getPlayerLevel(clientId) then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dslap: ^9sorry, but your intended victim has a higher admin level than you do.\";")
return true
elseif et.gentity_get(cmdClient, "sess.sessionTeam") ~= constants.TEAM_AXIS and et.gentity_get(cmdClient, "sess.sessionTeam") ~= constants.TEAM_ALLIES then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dslap: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is not playing.\";")
return true
elseif et.gentity_get(cmdClient, "health") <= 0 then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dslap: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9is not alive.\";")
return true
end