function BlackhawkHVehicle::onImpact(%this, %obj, %data)
{
%speed = vectorLen(%obj.getVelocity());
if(%speed < 2)
return;
%p = new Projectile()
{
dataBlock = VehicleExplosionProjectile;
initialPosition = %obj.getPosition();
client = %obj.lastDamageClient;
sourceClient = %obj.lastDamageClient;
};
MissionCleanup.add(%p);
if(%obj.destroyed)
return;
%obj.setDamageLevel(%this.maxDamage);
%obj.destroyed = 1;
%obj.schedule(%this.burnTime, "finalExplosion");
if(isObject(getminigamefromobject(%obj)))
%respawn = getminigamefromobject(%obj).vehicleReSpawnTime;
%obj.spawnBrick.schedule(%respawn,"spawnVehicle");
}
this is an UPDATED impact code which should be used over strato's helicopter. it is still not completely polished but should work great inside of a minigame and prevent crashing. replace the needed datablocks.
i am going to sleep and i might have a new version of that code tomorrow. there is a problem that allows crashing outside of a minigame and i am too lazy to check if %respawn is in ms or seconds