mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-05-14 16:14:49 +00:00
Compare commits
4 Commits
b3967606f4
...
02761a1013
Author | SHA1 | Date | |
---|---|---|---|
|
02761a1013 | ||
|
093dc9cd8c | ||
|
a3266c6de3 | ||
|
0ea6672804 |
@ -207,8 +207,11 @@ init()
|
|||||||
if ( !isdefined( game[ "botWarfare" ] ) )
|
if ( !isdefined( game[ "botWarfare" ] ) )
|
||||||
{
|
{
|
||||||
game[ "botWarfare" ] = true;
|
game[ "botWarfare" ] = true;
|
||||||
|
game[ "botWarfareInitTime" ] = gettime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
level.bot_inittime = gettime();
|
||||||
|
|
||||||
level.defuseobject = undefined;
|
level.defuseobject = undefined;
|
||||||
level.bots_smokelist = List();
|
level.bots_smokelist = List();
|
||||||
level.tbl_perkdata[ 0 ][ "reference_full" ] = true;
|
level.tbl_perkdata[ 0 ][ "reference_full" ] = true;
|
||||||
@ -262,6 +265,7 @@ init()
|
|||||||
|
|
||||||
level thread onPlayerConnect();
|
level thread onPlayerConnect();
|
||||||
level thread handleBots();
|
level thread handleBots();
|
||||||
|
level thread onPlayerChat();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -440,6 +444,23 @@ fixPerksAndScriptKick()
|
|||||||
self.pers[ "isBot" ] = true;
|
self.pers[ "isBot" ] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
When a bot disconnects.
|
||||||
|
*/
|
||||||
|
onDisconnectPlayer()
|
||||||
|
{
|
||||||
|
name = self.name;
|
||||||
|
|
||||||
|
self waittill( "disconnect" );
|
||||||
|
waittillframeend;
|
||||||
|
|
||||||
|
for ( i = 0; i < level.bots.size; i++ )
|
||||||
|
{
|
||||||
|
bot = level.bots[ i ];
|
||||||
|
bot BotNotifyBotEvent( "connection", "disconnected", self, name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
When a bot disconnects.
|
When a bot disconnects.
|
||||||
*/
|
*/
|
||||||
@ -457,6 +478,14 @@ connected()
|
|||||||
{
|
{
|
||||||
self endon( "disconnect" );
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
for ( i = 0; i < level.bots.size; i++ )
|
||||||
|
{
|
||||||
|
bot = level.bots[ i ];
|
||||||
|
bot BotNotifyBotEvent( "connection", "connected", self, self.name );
|
||||||
|
}
|
||||||
|
|
||||||
|
self thread onDisconnectPlayer();
|
||||||
|
|
||||||
if ( !isdefined( self.pers[ "bot_host" ] ) )
|
if ( !isdefined( self.pers[ "bot_host" ] ) )
|
||||||
{
|
{
|
||||||
self thread doHostCheck();
|
self thread doHostCheck();
|
||||||
@ -1247,3 +1276,21 @@ doFiringThread()
|
|||||||
wait 1;
|
wait 1;
|
||||||
self.bots_firing = false;
|
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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -252,10 +252,43 @@ start_chat_watch()
|
|||||||
case "sd":
|
case "sd":
|
||||||
self thread bot_chat_sd_watch( a, b, c, d, e, f, g );
|
self thread bot_chat_sd_watch( a, b, c, d, e, f, g );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
bot_chat_connection_player_watch( conn, player, playername, d, e, f, g )
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
switch ( conn )
|
||||||
|
{
|
||||||
|
case "connected":
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "disconnected":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
start_startgame_watch
|
start_startgame_watch
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user