I'm having problems with a script. It should be damaging a player when it goes into the radiusdamage but when the projectile explodes and the player isn't in the radius damage area, it doesn't work.
function MolotovroostertailProjectile::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt)
{
//validate distance factor
if(%distanceFactor <= 0)
return;
else if(%distanceFactor > 1)
%distanceFactor = 1;
%damageAmt *= %distanceFactor;
if(%damageAmt)
{
//use default damage type if no damage type is given
%damageType = $DamageType::Radius;
if(%this.RadiusDamageType)
%damageType = %this.RadiusDamageType;
%col.damage(%obj, %pos, %damageAmt, %damageType);
echo("test");
continuousDamage(%obj,%pos,%this.damageRadius,%this.radiusDamage,"Fire",0,20000);
//burn the player?
if(%this.explosion.playerBurnTime > 0)
{
if(%col.getType() & ($TypeMasks::PlayerObjectType | $TypeMasks::CorpseObjectType))
{
//check for vehicle protection from burning
%doBurn = true;
if(%col.isMounted())
{
%mountData = %col.getObjectMount().getDataBlock();
if(%mountData.protectPassengersBurn)
%doBurn = false;
}
if(%doBurn)
%col.burn(%this.explosion.playerBurnTime * %distanceFactor);
}
}
}
}
function continuousDamage(%sourceObject, %position, %radius, %damage, %damageType, %impulse,%duration)
{
radiusDamage(%sourceObject, %position, %radius, %damage, %damageType, %impulse);
if (%duration<0) return;
schedule(500,0,"continuousDamage",%sourceObject, %position, %radius, %damage, %damageType, %impulse,%duration-500);
}
Can anyone help?