mirror of
https://github.com/ineedbots/iw2_bot_warfare.git
synced 2026-09-03 03:48:39 +00:00
grenades
This commit is contained in:
@@ -388,6 +388,7 @@ onPlayerConnect()
|
||||
player thread connected();
|
||||
player thread onDeath();
|
||||
player thread watchWeapons();
|
||||
player thread watchGrenades();
|
||||
player thread watchVelocity();
|
||||
player thread watchVars();
|
||||
player thread doPlayerModelFix();
|
||||
@@ -405,6 +406,39 @@ doPlayerModelFix()
|
||||
self.bot_model_fix = true;
|
||||
}
|
||||
|
||||
/*
|
||||
CoD2
|
||||
*/
|
||||
watchGrenades()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
grenadeTypes = getGrenadeTypes();
|
||||
grenadeAmmoCount = [];
|
||||
|
||||
for ( i = 0; i < grenadeTypes.size; i++ )
|
||||
{
|
||||
grenadeAmmoCount[ i ] = 0;
|
||||
}
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0.05;
|
||||
|
||||
for ( i = 0; i < grenadeTypes.size; i++ )
|
||||
{
|
||||
frac = self getAmmoCount( grenadeTypes[ i ] );
|
||||
oldFrac = grenadeAmmoCount[ i ];
|
||||
grenadeAmmoCount[ i ] = frac;
|
||||
|
||||
if ( frac < oldFrac && isalive( self ) )
|
||||
{
|
||||
self notify( "grenade_fire", undefined, grenadeTypes[ i ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CoD2
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user