This commit is contained in:
ineed bots
2026-08-25 16:54:34 -06:00
parent f1a24027d8
commit e07fa6ad6d
3 changed files with 225 additions and 4 deletions
+34
View File
@@ -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
*/