Game Development Community

Repair a Vheicle

by CIMO · in General Discussion · 09/10/2006 (4:11 am) · 4 replies

I use this for repair a player....
function AttrezzaturaMezziProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   // Apply health to colliding object if it needs it.
   // Works for all shapebase objects.
   if (%col.getDamageLevel() != 0 && %col.getState() !$= "Dead" )
   {
      %col.applyRepair(%this.repairAmount);
      %obj.respawn();
		if (%col.client)
			%message = "CURE EFFETTUATE!!";
			%time = 2;
			bottomPrint( %obj.client, %message, %time );
   }
}
But for repair a vheicle? how I must make?

#1
09/10/2006 (4:29 pm)
Never say to use this for repair a vehicle?
#2
09/10/2006 (10:14 pm)
Did you try this code, and did it work or not?

Also: the if() statement looks iffy. If you don't add braces around it, only the message assignment will be conditional.
#3
09/11/2006 (2:29 am)
This code workONLY on player.....
I would a modify this code for work on vehicle....
#4
09/11/2006 (4:09 pm)
Never person say to modify this for repair a vehicle?