mirror of
https://github.com/ineedbots/t4_bot_warfare.git
synced 2025-04-21 23:45:43 +00:00
chat event
This commit is contained in:
parent
825d147ea2
commit
746e10633a
@ -263,6 +263,7 @@ init()
|
||||
|
||||
level thread onPlayerConnect();
|
||||
level thread handleBots();
|
||||
level thread onPlayerChat();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1229,3 +1230,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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -272,10 +272,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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user