Deserteaglegold()
{
self endon("disconnect");
self endon ( "death" );
self notifyOnPlayerCommand( "open", "+actionslot 2" );
self.explosionEnabled = 0;
for(;;)
{
self waittill ( "open" );
self.explosionEnabled = 1;
self.curGunoff = self getCurrentWeapon();
self giveWeapon("killstreak_uav_mp");
self switchToWeapon("killstreak_uav_mp");
wait 2;
// self.curGuno = self getCurrentWeapon();
self giveWeapon("deserteaglegold_mp");
self switchToWeapon("deserteaglegold_mp");
self thread open();
self iPrintlnBold(" !");
self waittill ( "open" );
self.explosionEnabled = 0;
wait 0.1;
self switchToWeapon(self.curGunoff);
// self switchToWeapon(self.curGuno);
wait 0.1;
self iPrintlnBold(" !");
}
}
open()
{
self endon("disconnect");
self endon ( "death" );
for(;;)
{
self waittill ( "weapon_fired" );
if(self.explosionEnabled == 1)
{
forward = self getTagOrigin("j_head");
end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
level.chopper_fx["explode"]["medium"] = loadfx ("explosions/helicopter_explosion_secondary_small");
if(distance(SPLOSIONlocation, self.origin) > 250)
{
playfx(level.chopper_fx["explode"]["medium"], SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 250, 1500, 1000, self );
// MagicBullet( "ac130_40mm_mp", self geteye(), SPLOSIONlocation, self );
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}
currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}
}
wait 0.05;
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}