mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 22:05:44 +00:00
turret watcher
This commit is contained in:
parent
f683a78336
commit
289f2b3dc5
@ -285,6 +285,8 @@ init()
|
|||||||
|
|
||||||
level thread handleBots();
|
level thread handleBots();
|
||||||
level thread onPlayerChat();
|
level thread onPlayerChat();
|
||||||
|
|
||||||
|
array_thread( getentarray( "misc_turret", "classname" ), ::turret_monitoruse_watcher );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1366,3 +1368,39 @@ onPlayerChat()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Monitors turret usage
|
||||||
|
*/
|
||||||
|
turret_monitoruse_watcher()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill ( "trigger", player );
|
||||||
|
|
||||||
|
self monitor_player_turret( player );
|
||||||
|
|
||||||
|
self.owner = undefined;
|
||||||
|
|
||||||
|
if ( isdefined( player ) )
|
||||||
|
{
|
||||||
|
player.turret = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
While player uses turret
|
||||||
|
*/
|
||||||
|
monitor_player_turret( player )
|
||||||
|
{
|
||||||
|
player endon( "death" );
|
||||||
|
player endon( "disconnect" );
|
||||||
|
|
||||||
|
player.turret = self;
|
||||||
|
self.owner = player;
|
||||||
|
|
||||||
|
self waittill( "turret_deactivate" );
|
||||||
|
}
|
||||||
|
@ -683,6 +683,13 @@ watchPickupGun()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo have bots use turrets instead of just kicking them off of it
|
||||||
|
if ( isdefined( self.turret ) )
|
||||||
|
{
|
||||||
|
self thread use( 0.5 );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
weap = self getcurrentweapon();
|
weap = self getcurrentweapon();
|
||||||
|
|
||||||
if ( weap != "none" && self getammocount( weap ) )
|
if ( weap != "none" && self getammocount( weap ) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user