legacy-StarMech_LX
07-10-2003, 02:07 AM
Hey! I just started coding not that long ago, and i was working on a little mutator, heres a description: Players health goes down 1 ever .5 seconds, stops at 10, if under 10, goes back up until reached 10(unless of course they die), i made it to where no weapons are on the ground, but there are a few problems,
1. If you look in the code, it's suppose to replace all ammo with "IonStar.TheNone" which is nothing, so it should disappear.
2. When you kill a player, your health is supposed to go back up to 150... WTF isn't that happening!?
3. I'm trying to make it to where the only weapon they have in their inventory is the shield gun.
4. When they spawn, how do you make it to where they spawn with 150 health?
Thats it... heres the code:
//================================================== ===========================
// Deathstroke.
//================================================== ===========================
class Deathstroke extends Mutator;
var() float ConversionRatio;
var bool bdeathstroke;
event PreBeginPlay()
{
SetTimer(0.5,true);
bdeathstroke = false;
}
function Timer()
{
local Controller C;
for (C = Level.ControllerList; C != None; C = C.NextController)
{
if (C.Pawn != None && C.Pawn.Health > 10 )
{
C.Pawn.Health = Min( C.Pawn.Health - 1, C.Pawn.HealthMax);
}
if (C.Pawn != None && C.Pawn.Health < 10 && C.Pawn.Health > 0)
{
C.Pawn.Health = Min( C.Pawn.Health + 1, C.Pawn.HealthMax);
}
}
}
function ScoreKill(Pawn Killer, Pawn Killed)
{
if ( (Killer != None) && (Killer != None) )
Killer.Health = Killer.Health + 100;
}
function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
{
bSuperRelevant = 0;
if ( xWeaponBase(Other) != None )
{
if ( xWeaponBase(Other).WeaponType != None )
xWeaponBase(Other).WeaponType = None;
else
return true;
}
else if ( WeaponPickup(Other) != None )
{
return true;
}
else if ( UTAmmoPickup(Other) != None )
{
return true;
}
return true;
return true;
}
Thanks for your help : D
1. If you look in the code, it's suppose to replace all ammo with "IonStar.TheNone" which is nothing, so it should disappear.
2. When you kill a player, your health is supposed to go back up to 150... WTF isn't that happening!?
3. I'm trying to make it to where the only weapon they have in their inventory is the shield gun.
4. When they spawn, how do you make it to where they spawn with 150 health?
Thats it... heres the code:
//================================================== ===========================
// Deathstroke.
//================================================== ===========================
class Deathstroke extends Mutator;
var() float ConversionRatio;
var bool bdeathstroke;
event PreBeginPlay()
{
SetTimer(0.5,true);
bdeathstroke = false;
}
function Timer()
{
local Controller C;
for (C = Level.ControllerList; C != None; C = C.NextController)
{
if (C.Pawn != None && C.Pawn.Health > 10 )
{
C.Pawn.Health = Min( C.Pawn.Health - 1, C.Pawn.HealthMax);
}
if (C.Pawn != None && C.Pawn.Health < 10 && C.Pawn.Health > 0)
{
C.Pawn.Health = Min( C.Pawn.Health + 1, C.Pawn.HealthMax);
}
}
}
function ScoreKill(Pawn Killer, Pawn Killed)
{
if ( (Killer != None) && (Killer != None) )
Killer.Health = Killer.Health + 100;
}
function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
{
bSuperRelevant = 0;
if ( xWeaponBase(Other) != None )
{
if ( xWeaponBase(Other).WeaponType != None )
xWeaponBase(Other).WeaponType = None;
else
return true;
}
else if ( WeaponPickup(Other) != None )
{
return true;
}
else if ( UTAmmoPickup(Other) != None )
{
return true;
}
return true;
return true;
}
Thanks for your help : D