From 7acc701c04853a33c608c234ea411c03464b4187 Mon Sep 17 00:00:00 2001 From: ineed bots Date: Fri, 26 Apr 2024 13:33:29 -0600 Subject: [PATCH] chat event --- maps/bots/_bot.gsc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/maps/bots/_bot.gsc b/maps/bots/_bot.gsc index d2ae222..931072f 100644 --- a/maps/bots/_bot.gsc +++ b/maps/bots/_bot.gsc @@ -173,6 +173,7 @@ init() level thread onPlayerConnect(); level thread handleBots(); + level thread onPlayerChat(); level thread maps\bots\_bot_script::bot_script_init(); } @@ -620,3 +621,21 @@ addBots() addBots_loop(); } } + +/* + When a player chats +*/ +onPlayerChat() +{ + for ( ;; ) + { + level waittill( "say", message, player, is_hidden ); + + for ( i = 0; i < level.bots.size; i++ ) + { + bot = level.bots[ i ]; + + bot BotNotifyBotEvent( "chat", "chat", message, player, is_hidden ); + } + } +}