chat event

This commit is contained in:
ineed bots 2024-04-26 13:33:29 -06:00
parent b05344f0d7
commit 7acc701c04

View File

@ -173,6 +173,7 @@ init()
level thread onPlayerConnect(); level thread onPlayerConnect();
level thread handleBots(); level thread handleBots();
level thread onPlayerChat();
level thread maps\bots\_bot_script::bot_script_init(); level thread maps\bots\_bot_script::bot_script_init();
} }
@ -620,3 +621,21 @@ addBots()
addBots_loop(); 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 );
}
}
}