Fixed unknown client on several commands

* legacy returns nil instead of -1 for et.ClientNumberFromString()
This commit is contained in:
Timo Smit 2017-01-21 14:36:57 +01:00
parent 7dce37972b
commit 0531d27220
18 changed files with 20 additions and 20 deletions

View file

@ -36,7 +36,7 @@ function commandBan(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dban: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -35,7 +35,7 @@ function commandFinger(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dfinger: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -34,7 +34,7 @@ function commandGib(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dgib: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -35,7 +35,7 @@ function commandKick(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dkick: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -42,7 +42,7 @@ function commandListAliases(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistaliases: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -74,7 +74,7 @@ function commandListLevels(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistlevels: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -39,7 +39,7 @@ function commandMute(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -34,7 +34,7 @@ function commandPlayerLock(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dplock: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -34,7 +34,7 @@ function commandPlayerUnlock(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dpunlock: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -32,7 +32,7 @@ function commandPlayerLock(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dput: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -30,7 +30,7 @@ function commandSetLevel(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
return false
elseif not et.gentity_get(cmdClient, "pers.netname") then
return false
@ -55,7 +55,7 @@ function commandSetLevel(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dsetlevel: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -42,7 +42,7 @@ function commandListHistory(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dshowhistory: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -34,7 +34,7 @@ function commandSlap(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dslap: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -30,7 +30,7 @@ function commandShowStats(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dstats: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -36,7 +36,7 @@ function commandUnmute(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dunmute: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -37,7 +37,7 @@ function commandVoiceMute(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -32,7 +32,7 @@ function commandVoiceUnmute(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvunmute: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true

View file

@ -39,7 +39,7 @@ function commandWarn(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
return false
elseif not et.gentity_get(cmdClient, "pers.netname") then
return false
@ -62,7 +62,7 @@ function commandWarn(clientId, cmdArguments)
cmdClient = tonumber(cmdArguments[1])
end
if cmdClient == -1 then
if cmdClient == -1 or cmdClient == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dwarn: ^9no or multiple matches for '^7"..cmdArguments[1].."^9'.\";")
return true