Merge pull request #5 from rmarquis/develop/1.2.1

This commit is contained in:
Timo Smit 2019-11-10 13:42:49 +01:00 committed by GitHub
commit f5da5b151b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,29 +19,14 @@ local auth = wolfa_requireModule("auth.auth")
local commands = wolfa_requireModule("commands.commands")
local settings = wolfa_requireModule("util.settings")
function commandShuffle(clientId, command, type)
if type == "xp" then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dshuffle: ^9teams were shuffled by XP.\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "shuffle_teams")
elseif type == "sr" then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dshuffle: ^9teams were shuffled by SR.\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "shuffle_teams_sr")
elseif type == nil then
function commandShuffle(clientId, command)
if settings.get("fs_game") == "legacy" then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dshuffle: ^9teams were shuffled by SR.\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "shuffle_teams_sr")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dshuffle: ^9teams were shuffled.\";")
else
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dshuffle: ^9teams were shuffled by XP.\";")
end
et.trap_SendConsoleCommand(et.EXEC_APPEND, "shuffle_teams")
end
else
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dshuffle usage: "..commands.getadmin("shuffle")["syntax"].."\";")
end
return true
end
commands.addadmin("shuffle", commandShuffle, auth.PERM_SHUFFLE, "shuffle the teams to try and even them", "^2!shuffle ^9(^hxp|sr^9)", nil, (settings.get("g_standalone") == 0))
commands.addadmin("shuffle", commandShuffle, auth.PERM_SHUFFLE, "shuffle the teams to try and even them", "^2!shuffle ^9", nil, (settings.get("g_standalone") == 0))