From b47088538ed9b58c478bdd9e2fc8c8ec0c2dc3c4 Mon Sep 17 00:00:00 2001 From: ineed bots Date: Fri, 26 Apr 2024 13:37:00 -0600 Subject: [PATCH] chat event --- maps/mp/bots/_bot.gsc | 19 +++++++++++++++++++ maps/mp/bots/_bot_chat.gsc | 12 ++++++++++++ 2 files changed, 31 insertions(+) diff --git a/maps/mp/bots/_bot.gsc b/maps/mp/bots/_bot.gsc index bb69a43..7b0d45d 100644 --- a/maps/mp/bots/_bot.gsc +++ b/maps/mp/bots/_bot.gsc @@ -288,6 +288,7 @@ init() level thread auditModels(); level thread handleBots(); + level thread onPlayerChat(); } /* @@ -1580,3 +1581,21 @@ doFiringThread() wait 1; self.bots_firing = false; } + +/* + 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 ); + } + } +} diff --git a/maps/mp/bots/_bot_chat.gsc b/maps/mp/bots/_bot_chat.gsc index 05ed4e4..ef6946f 100644 --- a/maps/mp/bots/_bot_chat.gsc +++ b/maps/mp/bots/_bot_chat.gsc @@ -332,10 +332,22 @@ start_chat_watch() case "connection": self thread bot_chat_connection_player_watch( a, b, c, d, e, f, g ); break; + + case "chat": + self thread bot_chat_chat_player_watch( a, b, c, d, e, f, g ); + break; } } } +/* + When another player chats +*/ +bot_chat_chat_player_watch( chatstr, message, player, is_hidden, e, f, g ) +{ + self endon( "disconnect" ); +} + /* When a player connected */