Correctly enable commands on legacy

This commit is contained in:
Timo Smit 2019-01-31 11:33:41 +01:00
parent a253e00d15
commit 2bd45363e5
3 changed files with 6 additions and 5 deletions

View file

@ -26,4 +26,4 @@ function commandShuffleSR(clientId, command)
return true
end
commands.addadmin("shufflesr", commandShuffleSR, auth.PERM_SHUFFLE, "shuffle the teams by Skill Rating to try and even them", nil, nil, (settings.get("fs_game") == "legacy"))
commands.addadmin("shufflesr", commandShuffleSR, auth.PERM_SHUFFLE, "shuffle the teams by Skill Rating to try and even them", nil, nil, (settings.get("fs_game") ~= "legacy"))

View file

@ -91,5 +91,5 @@ function commandPersonalMessage(clientId, command, target, ...)
return true
end
commands.addclient("pm", commandPersonalMessage, "", "[^2name^7|^2slot#^7] [^2message^7]", true, (settings.get("fs_game") == "legacy"))
commands.addclient("m", commandPersonalMessage, "", "[^2name^7|^2slot#^7] [^2message^7]", true, (settings.get("fs_game") == "legacy"))
commands.addclient("pm", commandPersonalMessage, "", "[^2name^7|^2slot#^7] [^2message^7]", true, (settings.get("fs_game") ~= "legacy"))
commands.addclient("m", commandPersonalMessage, "", "[^2name^7|^2slot#^7] [^2message^7]", true, (settings.get("fs_game") ~= "legacy"))

View file

@ -19,11 +19,12 @@ local commands = wolfa_requireModule("commands.commands")
local util = wolfa_requireModule("util.util")
function commandClientCPM(command, clientId, text)
function commandClientCPM(command, clientId, text, type)
local clientId = tonumber(clientId)
local type = tonumber(type) and tonumber(type) or 4
if clientId and clientId ~= -1337 then -- -1337 because -1 is a magic number/broadcasted to all clients
et.trap_SendServerCommand(clientId, "cpm \""..text.."\";")
et.trap_SendServerCommand(clientId, "cpm \""..text.."\" "..type..";")
elseif clientId then
et.G_Print(util.removeColors(text).."\n")
end