From 0e9181f1886d7699bbc1ea261afa7a06d557c580 Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Sat, 25 Mar 2023 22:32:58 +0100 Subject: [PATCH] chat_commands 1.0.2 Added default 1s wait time to TellPlayer in case no wait time is passed Added TellAllPlayers util function Added InvalidRoundError error --- chat_commands/chat_commands.gsc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/chat_commands/chat_commands.gsc b/chat_commands/chat_commands.gsc index 15e8643..3c1fac4 100644 --- a/chat_commands/chat_commands.gsc +++ b/chat_commands/chat_commands.gsc @@ -270,6 +270,11 @@ ChatListener() TellPlayer(messages, waitTime, isCommand) { + if (!IsDefined(waitTime)) + { + waitTime = 1; + } + for (i = 0; i < messages.size; i++) { message = messages[i]; @@ -288,6 +293,19 @@ TellPlayer(messages, waitTime, isCommand) } } +TellAllPlayers(messages, waitTime) +{ + if (!IsDefined(waitTime)) + { + waitTime = 1; + } + + foreach (player in level.players) + { + player TellPlayer(messages, waitTime, false); + } +} + /* Player section */ @@ -361,6 +379,11 @@ DvarDoesNotExistError(dvarName) return array("The dvar " + dvarName + " doesn't exist"); } +InvalidRoundError(roundNumber) +{ + return array(roundNumber + " is not a valid round number"); +} + /* Utils section */