From d58a228ed2a28eeabd1b3182799f93a5e1657898 Mon Sep 17 00:00:00 2001 From: Timo Smit Date: Sat, 28 Jan 2017 17:24:19 +0100 Subject: [PATCH] Fixed 'console:' prefix on legacymod (fixes #66) --- luamods/wolfadmin/admin/balancer.lua | 6 +++--- luamods/wolfadmin/admin/mutes.lua | 2 +- luamods/wolfadmin/commands/admin/balance.lua | 4 ++-- luamods/wolfadmin/commands/admin/ban.lua | 2 +- luamods/wolfadmin/commands/admin/enablevote.lua | 4 ++-- luamods/wolfadmin/commands/admin/kickbots.lua | 6 +++--- luamods/wolfadmin/commands/admin/listmaps.lua | 6 +++--- luamods/wolfadmin/commands/admin/lock.lua | 4 ++-- luamods/wolfadmin/commands/admin/mute.lua | 2 +- luamods/wolfadmin/commands/admin/needbots.lua | 6 +++--- luamods/wolfadmin/commands/admin/plock.lua | 6 +++--- luamods/wolfadmin/commands/admin/punlock.lua | 6 +++--- luamods/wolfadmin/commands/admin/put.lua | 2 +- luamods/wolfadmin/commands/admin/putbots.lua | 6 +++--- luamods/wolfadmin/commands/admin/resetsprees.lua | 8 ++++---- luamods/wolfadmin/commands/admin/rules.lua | 2 +- luamods/wolfadmin/commands/admin/sprees.lua | 6 +++--- luamods/wolfadmin/commands/admin/unlock.lua | 4 ++-- luamods/wolfadmin/commands/admin/unmute.lua | 2 +- luamods/wolfadmin/commands/admin/vmute.lua | 4 ++-- luamods/wolfadmin/commands/admin/vunmute.lua | 6 +++--- luamods/wolfadmin/game/game.lua | 8 ++++---- luamods/wolfadmin/game/sprees.lua | 14 +++++++------- luamods/wolfadmin/game/voting.lua | 4 ++-- 24 files changed, 60 insertions(+), 60 deletions(-) diff --git a/luamods/wolfadmin/admin/balancer.lua b/luamods/wolfadmin/admin/balancer.lua index 97f6299..e08a00e 100644 --- a/luamods/wolfadmin/admin/balancer.lua +++ b/luamods/wolfadmin/admin/balancer.lua @@ -47,7 +47,7 @@ function balancer.balance(byAdmin, forceBalance) evenerCount = 0 if byAdmin then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^devener: ^9teams are even.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^devener: ^9teams are even.\";") end return @@ -82,7 +82,7 @@ function balancer.balance(byAdmin, forceBalance) local player = balancer.findPlayer(teamsData[teamGreater], teamGreater, teamSmaller) et.trap_SendConsoleCommand(et.EXEC_APPEND, "!put "..player.." "..(teamGreater == constants.TEAM_AXIS and constants.TEAM_ALLIES_SC or constants.TEAM_AXIS_SC)..";") - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^devener: ^9thank you, ^7"..et.gentity_get(player, "pers.netname").."^9, for helping to even the teams.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^devener: ^9thank you, ^7"..et.gentity_get(player, "pers.netname").."^9, for helping to even the teams.\";") teamsData = teams.get() end @@ -92,7 +92,7 @@ function balancer.balance(byAdmin, forceBalance) local teamGreaterName, teamSmallerName = util.getTeamName(teamGreater), util.getTeamName(teamSmaller) local teamGreaterColor, teamSmallerColor = util.getTeamColor(teamGreater), util.getTeamColor(teamSmaller) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^devener: ^9teams seem unfair, would someone from "..teamGreaterColor..teamGreaterName.." ^9please switch to "..teamSmallerColor..teamSmallerName.."^9?\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^devener: ^9teams seem unfair, would someone from "..teamGreaterColor..teamGreaterName.." ^9please switch to "..teamSmallerColor..teamSmallerName.."^9?\";") end end end diff --git a/luamods/wolfadmin/admin/mutes.lua b/luamods/wolfadmin/admin/mutes.lua index 5ea0a4e..a4e9f0d 100644 --- a/luamods/wolfadmin/admin/mutes.lua +++ b/luamods/wolfadmin/admin/mutes.lua @@ -69,7 +69,7 @@ function mutes.checkUnmutes() if players.isMuted(clientId) and players.getMuteExpiresAt(clientId) < os.time() then mutes.removeByClient(clientId) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dunmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been automatically unmuted\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dunmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been automatically unmuted\";") end end end diff --git a/luamods/wolfadmin/commands/admin/balance.lua b/luamods/wolfadmin/commands/admin/balance.lua index d704f84..8d2388d 100644 --- a/luamods/wolfadmin/commands/admin/balance.lua +++ b/luamods/wolfadmin/commands/admin/balance.lua @@ -24,7 +24,7 @@ function commandBalance(clientId, command, action) if not balancer.isRunning() then balancer.enable() - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dbalancer: ^9balancer enabled.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dbalancer: ^9balancer enabled.\";") else et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dbalancer: ^9balancer is already running.\";") end @@ -32,7 +32,7 @@ function commandBalance(clientId, command, action) if balancer.isRunning() then balancer.disable() - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dbalancer: ^9balancer disabled.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dbalancer: ^9balancer disabled.\";") else et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dbalancer: ^9balancer was not running.\";") end diff --git a/luamods/wolfadmin/commands/admin/ban.lua b/luamods/wolfadmin/commands/admin/ban.lua index 8dd7a79..a42db24 100644 --- a/luamods/wolfadmin/commands/admin/ban.lua +++ b/luamods/wolfadmin/commands/admin/ban.lua @@ -75,7 +75,7 @@ function commandBan(clientId, command, victim, ...) bans.add(cmdClient, clientId, duration, reason) history.add(cmdClient, clientId, "ban", reason) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dban: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been banned for "..duration.." seconds\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dban: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been banned for "..duration.." seconds\";") return true end diff --git a/luamods/wolfadmin/commands/admin/enablevote.lua b/luamods/wolfadmin/commands/admin/enablevote.lua index 3cec81f..8d92560 100644 --- a/luamods/wolfadmin/commands/admin/enablevote.lua +++ b/luamods/wolfadmin/commands/admin/enablevote.lua @@ -20,8 +20,8 @@ local auth = require (wolfa_getLuaPath()..".auth.auth") local voting = require (wolfa_getLuaPath()..".game.voting") function commandEnableVote(clientId, command, ...) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^denablevote: ^9next map voting has been enabled.\";") - + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^denablevote: ^9next map voting has been enabled.\";") + voting.force("nextmap") return true diff --git a/luamods/wolfadmin/commands/admin/kickbots.lua b/luamods/wolfadmin/commands/admin/kickbots.lua index c814388..83537d6 100644 --- a/luamods/wolfadmin/commands/admin/kickbots.lua +++ b/luamods/wolfadmin/commands/admin/kickbots.lua @@ -21,9 +21,9 @@ local bots = require (wolfa_getLuaPath()..".game.bots") function commandBotsOff(clientId, command) bots.enable(false) - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dkickbots: ^9bots were toggled off.\";") - + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dkickbots: ^9bots were toggled off.\";") + return true end commands.addadmin("kickbots", commandBotsOff, auth.PERM_BOTADMIN, "kicks all bots from the game") diff --git a/luamods/wolfadmin/commands/admin/listmaps.lua b/luamods/wolfadmin/commands/admin/listmaps.lua index f553963..4b9d1e5 100644 --- a/luamods/wolfadmin/commands/admin/listmaps.lua +++ b/luamods/wolfadmin/commands/admin/listmaps.lua @@ -31,9 +31,9 @@ function commandListMaps(clientId, command) output = (output ~= "") and output.." "..prefix..map or map end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dlistmaps: ^9"..output.. "\";") - + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dlistmaps: ^9"..output.. "\";") + return true end commands.addadmin("listmaps", commandListMaps, auth.PERM_LISTMAPS, "display the maps in the rotation") diff --git a/luamods/wolfadmin/commands/admin/lock.lua b/luamods/wolfadmin/commands/admin/lock.lua index f8164be..c25d2df 100644 --- a/luamods/wolfadmin/commands/admin/lock.lua +++ b/luamods/wolfadmin/commands/admin/lock.lua @@ -56,7 +56,7 @@ function commandLock(clientId, command, team) teams.lock(constants.TEAM_ALLIES) teams.lock(constants.TEAM_SPECTATORS) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dlock: ^9all teams have been locked.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dlock: ^9all teams have been locked.\";") return false end @@ -64,7 +64,7 @@ function commandLock(clientId, command, team) local team = util.getTeamFromCode(team) teams.lock(team) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dlock: "..util.getTeamColor(team)..util.getTeamName(team).." ^9team has been locked.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dlock: "..util.getTeamColor(team)..util.getTeamName(team).." ^9team has been locked.\";") return false end diff --git a/luamods/wolfadmin/commands/admin/mute.lua b/luamods/wolfadmin/commands/admin/mute.lua index dd55380..972a6af 100644 --- a/luamods/wolfadmin/commands/admin/mute.lua +++ b/luamods/wolfadmin/commands/admin/mute.lua @@ -82,7 +82,7 @@ function commandMute(clientId, command, victim, ...) mutes.add(cmdClient, clientId, players.MUTE_CHAT + players.MUTE_VOICE, duration, reason) history.add(cmdClient, clientId, "mute", reason) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been muted for "..duration.." seconds\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been muted for "..duration.." seconds\";") return true end diff --git a/luamods/wolfadmin/commands/admin/needbots.lua b/luamods/wolfadmin/commands/admin/needbots.lua index c7706c2..118bbbc 100644 --- a/luamods/wolfadmin/commands/admin/needbots.lua +++ b/luamods/wolfadmin/commands/admin/needbots.lua @@ -21,9 +21,9 @@ local bots = require (wolfa_getLuaPath()..".game.bots") function commandBotsOn(clientId, command) bots.enable(true) - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dneedbots: ^9bots were toggled on.\";") - + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dneedbots: ^9bots were toggled on.\";") + return true end commands.addadmin("needbots", commandBotsOn, auth.PERM_BOTADMIN, "adds bots to the game") diff --git a/luamods/wolfadmin/commands/admin/plock.lua b/luamods/wolfadmin/commands/admin/plock.lua index f69bdbb..3a3b863 100644 --- a/luamods/wolfadmin/commands/admin/plock.lua +++ b/luamods/wolfadmin/commands/admin/plock.lua @@ -57,9 +57,9 @@ function commandPlayerLock(clientId, command, victim) return true end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dplock: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been locked to his team\";") - + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dplock: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been locked to his team\";") + players.setTeamLocked(cmdClient, true) return true diff --git a/luamods/wolfadmin/commands/admin/punlock.lua b/luamods/wolfadmin/commands/admin/punlock.lua index 2735d18..b012d69 100644 --- a/luamods/wolfadmin/commands/admin/punlock.lua +++ b/luamods/wolfadmin/commands/admin/punlock.lua @@ -49,9 +49,9 @@ function commandPlayerUnlock(clientId, command, victim) return true end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dpunlock: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been unlocked from his team\";") - + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dpunlock: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been unlocked from his team\";") + players.setTeamLocked(cmdClient, false) return true diff --git a/luamods/wolfadmin/commands/admin/put.lua b/luamods/wolfadmin/commands/admin/put.lua index 15d6fe8..f1a0607 100644 --- a/luamods/wolfadmin/commands/admin/put.lua +++ b/luamods/wolfadmin/commands/admin/put.lua @@ -60,7 +60,7 @@ function commandPlayerLock(clientId, command, victim, team) -- cannot unbalance teams in certain mods (see g_svcmds.c:SetTeam) -- fixed in legacymod - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dput: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been put to "..util.getTeamColor(team)..util.getTeamName(team).."\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dput: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been put to "..util.getTeamColor(team)..util.getTeamName(team).."\";") admin.putPlayer(cmdClient, team) diff --git a/luamods/wolfadmin/commands/admin/putbots.lua b/luamods/wolfadmin/commands/admin/putbots.lua index 01c0b58..05051e0 100644 --- a/luamods/wolfadmin/commands/admin/putbots.lua +++ b/luamods/wolfadmin/commands/admin/putbots.lua @@ -32,13 +32,13 @@ function commandPutBots(clientId, command, team) team = util.getTeamFromCode(team) bots.put(team) - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dputbots: ^9all bots were set to ^7"..util.getTeamColor(team)..util.getTeamName(team).." ^9team.\";") + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dputbots: ^9all bots were set to ^7"..util.getTeamColor(team)..util.getTeamName(team).." ^9team.\";") if (team == constants.TEAM_AXIS or team == constants.TEAM_ALLIES) and balancer.isRunning() then balancer.disable() - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dbalancer: ^9balancer disabled.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dbalancer: ^9balancer disabled.\";") end return true diff --git a/luamods/wolfadmin/commands/admin/resetsprees.lua b/luamods/wolfadmin/commands/admin/resetsprees.lua index ff4142d..c028f23 100644 --- a/luamods/wolfadmin/commands/admin/resetsprees.lua +++ b/luamods/wolfadmin/commands/admin/resetsprees.lua @@ -30,12 +30,12 @@ function commandResetSprees(clientId, command, map) if map and map == "all" then sprees.reset(true) - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dresetsprees: ^9all spree records have been reset.\";") + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dresetsprees: ^9all spree records have been reset.\";") else sprees.reset() - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dresetsprees: ^9spree records have been reset for map '^7"..game.getMap().."^9'.\";") + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dresetsprees: ^9spree records have been reset for map '^7"..game.getMap().."^9'.\";") end return true diff --git a/luamods/wolfadmin/commands/admin/rules.lua b/luamods/wolfadmin/commands/admin/rules.lua index 324a292..9d1ed9a 100644 --- a/luamods/wolfadmin/commands/admin/rules.lua +++ b/luamods/wolfadmin/commands/admin/rules.lua @@ -37,7 +37,7 @@ function commandRules(clientId, command, rule) local rule = rules.get(string.lower(rule)) if rule then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^drules: "..rules.get(string.lower(cmdArguments[1])).."\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^drules: "..rules.get(string.lower(cmdArguments[1])).."\";") end end diff --git a/luamods/wolfadmin/commands/admin/sprees.lua b/luamods/wolfadmin/commands/admin/sprees.lua index 7dbd878..65ac23d 100644 --- a/luamods/wolfadmin/commands/admin/sprees.lua +++ b/luamods/wolfadmin/commands/admin/sprees.lua @@ -33,13 +33,13 @@ function commandShowSprees(clientId, command) et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dsprees: ^9there are no records for this map yet.\"") else if records["ksrecord"] and records["ksrecord"] > 0 then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dsprees: ^9longest kill spree (^7"..records["ksrecord"].."^9) by ^7"..records["ksname"].."^9.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dsprees: ^9longest kill spree (^7"..records["ksrecord"].."^9) by ^7"..records["ksname"].."^9.\";") end if records["dsrecord"] and records["dsrecord"] > 0 then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dsprees: ^9longest death spree (^7"..records["dsrecord"].."^9) by ^7"..records["dsname"].."^9.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dsprees: ^9longest death spree (^7"..records["dsrecord"].."^9) by ^7"..records["dsname"].."^9.\";") end if records["rsrecord"] and records["rsrecord"] > 0 then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dsprees: ^9longest revive spree (^7"..records["rsrecord"].."^9) by ^7"..records["rsname"].."^9.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dsprees: ^9longest revive spree (^7"..records["rsrecord"].."^9) by ^7"..records["rsname"].."^9.\";") end end diff --git a/luamods/wolfadmin/commands/admin/unlock.lua b/luamods/wolfadmin/commands/admin/unlock.lua index 806507f..fe7cd88 100644 --- a/luamods/wolfadmin/commands/admin/unlock.lua +++ b/luamods/wolfadmin/commands/admin/unlock.lua @@ -56,7 +56,7 @@ function commandUnlock(clientId, command, team) teams.unlock(constants.TEAM_ALLIES) teams.unlock(constants.TEAM_SPECTATORS) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dlock: ^9all teams have been unlocked.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dlock: ^9all teams have been unlocked.\";") return false end @@ -64,7 +64,7 @@ function commandUnlock(clientId, command, team) local team = util.getTeamFromCode(team) teams.unlock(team) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dlock: "..util.getTeamColor(team)..util.getTeamName(team).." ^9team has been unlocked.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dlock: "..util.getTeamColor(team)..util.getTeamName(team).." ^9team has been unlocked.\";") return false end diff --git a/luamods/wolfadmin/commands/admin/unmute.lua b/luamods/wolfadmin/commands/admin/unmute.lua index 0061cf0..e4416f5 100644 --- a/luamods/wolfadmin/commands/admin/unmute.lua +++ b/luamods/wolfadmin/commands/admin/unmute.lua @@ -52,7 +52,7 @@ function commandUnmute(clientId, command, victim) return true end - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dunmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been unmuted\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dunmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been unmuted\";") mutes.removeByClient(cmdClient) diff --git a/luamods/wolfadmin/commands/admin/vmute.lua b/luamods/wolfadmin/commands/admin/vmute.lua index ff3fae6..b107087 100644 --- a/luamods/wolfadmin/commands/admin/vmute.lua +++ b/luamods/wolfadmin/commands/admin/vmute.lua @@ -80,8 +80,8 @@ function commandVoiceMute(clientId, command, victim, ...) mutes.add(cmdClient, clientId, players.MUTE_VOICE, duration, reason) history.add(cmdClient, clientId, "vmute", reason) - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dvmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been voicemuted for "..duration.." seconds\";") - + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dvmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been voicemuted for "..duration.." seconds\";") + return true end commands.addadmin("vmute", commandVoiceMute, auth.PERM_VOICEMUTE, "voicemutes a player", "^9[^3name|slot#^9]") diff --git a/luamods/wolfadmin/commands/admin/vunmute.lua b/luamods/wolfadmin/commands/admin/vunmute.lua index e856068..9304972 100644 --- a/luamods/wolfadmin/commands/admin/vunmute.lua +++ b/luamods/wolfadmin/commands/admin/vunmute.lua @@ -47,9 +47,9 @@ function commandVoiceUnmute(clientId, command, victim) return true end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dvunmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been unvoicemuted\";") - + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dvunmute: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been unvoicemuted\";") + mutes.removeByClient(cmdClient) return true diff --git a/luamods/wolfadmin/game/game.lua b/luamods/wolfadmin/game/game.lua index 809d616..8cb2ce0 100644 --- a/luamods/wolfadmin/game/game.lua +++ b/luamods/wolfadmin/game/game.lua @@ -76,11 +76,11 @@ function game.onstatechange(gameState) if gameState == 3 then -- do not display when there haven't been any kills if lastKillerId ~= nil then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dAnd the last kill of the round goes to.. ^7"..et.gentity_get(lastKillerId, "pers.netname").."^d!\";") - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dA total of ^7"..killCount.." ^dsoldiers died during this battle.\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dAnd the last kill of the round goes to.. ^7"..et.gentity_get(lastKillerId, "pers.netname").."^d!\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dA total of ^7"..killCount.." ^dsoldiers died during this battle.\";") end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dNext map: ^7"..game.getNextMap().."^d.\";") + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dNext map: ^7"..game.getNextMap().."^d.\";") end end events.handle("onGameStateChange", game.onstatechange) diff --git a/luamods/wolfadmin/game/sprees.lua b/luamods/wolfadmin/game/sprees.lua index 44cced8..ef1d4b5 100644 --- a/luamods/wolfadmin/game/sprees.lua +++ b/luamods/wolfadmin/game/sprees.lua @@ -131,8 +131,8 @@ function sprees.ongamestatechange(gameState) else db.addrecord(currentMapId, os.time(), constants.RECORD_KILL, currentRecords["ksrecord"], currentRecords["ksplayer"]) end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dsprees: ^9longest kill spree (^7"..currentRecords["ksrecord"].."^9) by ^7"..db.getlastalias(currentRecords["ksplayer"])["alias"].."^9.\";") + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dsprees: ^9longest kill spree (^7"..currentRecords["ksrecord"].."^9) by ^7"..db.getlastalias(currentRecords["ksplayer"])["alias"].."^9.\";") end if currentRecords["dsrecord"] and currentRecords["dsrecord"] > 0 then if db.getrecord(currentMapId, constants.RECORD_DEATH) then @@ -140,8 +140,8 @@ function sprees.ongamestatechange(gameState) else db.addrecord(currentMapId, os.time(), constants.RECORD_DEATH, currentRecords["dsrecord"], currentRecords["dsplayer"]) end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dsprees: ^9longest death spree (^7"..currentRecords["dsrecord"].."^9) by ^7"..db.getlastalias(currentRecords["dsplayer"])["alias"].."^9.\";") + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dsprees: ^9longest death spree (^7"..currentRecords["dsrecord"].."^9) by ^7"..db.getlastalias(currentRecords["dsplayer"])["alias"].."^9.\";") end if currentRecords["rsrecord"] and currentRecords["rsrecord"] > 0 then if db.getrecord(currentMapId, constants.RECORD_REVIVE) then @@ -149,8 +149,8 @@ function sprees.ongamestatechange(gameState) else db.addrecord(currentMapId, os.time(), constants.RECORD_REVIVE, currentRecords["rsrecord"], currentRecords["rsplayer"]) end - - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dsprees: ^9longest revive spree (^7"..currentRecords["rsrecord"].."^9) by ^7"..db.getlastalias(currentRecords["rsplayer"])["alias"].."^9.\";") + + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dsprees: ^9longest revive spree (^7"..currentRecords["rsrecord"].."^9) by ^7"..db.getlastalias(currentRecords["rsplayer"])["alias"].."^9.\";") end end end @@ -219,7 +219,7 @@ function sprees.onrevive(clientMedic, clientVictim) -- stats.set(clientMedic, "longestReviveSpree", stats.get(clientMedic, "currentReviveSpree") > stats.get(clientMedic, "longestReviveSpree") and stats.get(clientMedic, "currentReviveSpree") or stats.get(clientMedic, "longestReviveSpree")) if revivespreeMessages[playerSprees[clientMedic]["revive"]] then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^1REVIVE SPREE! ^*"..players.getName(clientMedic).." ^*"..revivespreeMessages[playerSprees[clientMedic]["revive"]]["msg"].." ^d(^3"..playerSprees[clientMedic]["revive"].." ^drevives in a row!)\";") + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^1REVIVE SPREE! ^*"..players.getName(clientMedic).." ^*"..revivespreeMessages[playerSprees[clientMedic]["revive"]]["msg"].." ^d(^3"..playerSprees[clientMedic]["revive"].." ^drevives in a row!)\";") end if (settings.get("g_botRecords") == 1 or not players.isBot(clientMedic)) and (not currentRecords["rsrecord"] or playerSprees[clientMedic]["revive"] > currentRecords["rsrecord"]) then diff --git a/luamods/wolfadmin/game/voting.lua b/luamods/wolfadmin/game/voting.lua index ff2b25f..a4aea14 100644 --- a/luamods/wolfadmin/game/voting.lua +++ b/luamods/wolfadmin/game/voting.lua @@ -52,8 +52,8 @@ function voting.isrestricted(type) end function voting.disablenextmap() - et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^dvote: ^9next map voting has automatically been disabled.\";") - + et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dvote: ^9next map voting has automatically been disabled.\";") + voting.allow("nextmap", 0) end