I need to make my guys die but I don't know how... This is the code I have at the moment:
code: code:
//=========================================================//
// Eruption - Mutator deals periodic damage to all players //
//=========================================================//
class MutEruption extends Mutator;
#exec OBJ LOAD File=MutatorArt.utx
var() int EruptionDamage;
var() float DamageInterval;
event PreBeginPlay()
{
SetTimer(DamageInterval,true);
}
function Timer()
{
local Controller E;
for (E = Level.ControllerList; E != None; E = E.NextController)
{
if (E.Pawn != None && E.Pawn.Health > 0 )
{
E.Pawn.Health = Min(E.Pawn.Health - (EruptionDamage + (Rand(20) - Rand(20))), E.Pawn.HealthMax);
if (E.Pawn != None && E.Pawn.Health <= 0 )
{
E.Pawn.Died (None, None, ???); // PROBLEM!!!
}
}
}
}
defaultproperties
{
EruptionDamage=30.0
DamageInterval=60.0
GroupName="Erupt"
FriendlyName="Eruption"
Description="All players take random amounts of damage periodically."
}
The practical upshot of which is that everyone takes varying amounts of damage (around 30) every 60 seconds or so (it's actually something like 53 for some reason but that's unimportant).
The problem is that when their health drops to 0, they dont die, they just carry on with 0 health, then negative health. That 'PROBLEM!!!' line seems to be correct apart from the third parameter, the ???. It's usually just entered as 'vector HitLocation' which describes the direction the player got shot from so they can go flying in the opposite direction when they die but my guys aren't dying like that so I need to either make a vector up or tell it doesn't need one. I've tried 'None', '0', '1', '0.1', '0,0', '(0,0)' but it always tells me there's a type mismatch in parameter 3 on that line.