From dfb4fd6bcaf6c4f46320120f9ddb4ce58f6878fe Mon Sep 17 00:00:00 2001 From: ineed bots Date: Thu, 25 Apr 2024 14:05:30 -0600 Subject: [PATCH] connection events --- maps/mp/bots/_bot.gsc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/maps/mp/bots/_bot.gsc b/maps/mp/bots/_bot.gsc index d4a277b..b0dee5c 100644 --- a/maps/mp/bots/_bot.gsc +++ b/maps/mp/bots/_bot.gsc @@ -486,7 +486,7 @@ killTags() { for ( i = 0; i < self.tags.size; i++ ) { - self.tags[ i ] delete(); + self.tags[ i ] delete (); } self.tags = undefined; @@ -518,6 +518,14 @@ onDisconnectPlayer() self killTags(); level.players = array_remove( level.players, self ); + + waittillframeend; + + for ( i = 0; i < level.bots.size; i++ ) + { + bot = level.bots[ i ]; + bot BotNotifyBotEvent( "connection", "disconnected", self, self.name ); + } } /* @@ -538,6 +546,13 @@ connected() self endon( "disconnect" ); level.players[ level.players.size ] = self; + + 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" ] ) ) @@ -1181,7 +1196,7 @@ watchNade() if ( timeSlow > 1 ) { thread launchSmoke( lastOrigin ); - self delete(); + self delete (); } wait 0.05;