SA-MP Forums Archive
Infinitely Vehicle Health - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Infinitely Vehicle Health (/showthread.php?tid=450595)



Infinitely Vehicle Health - Blackazur - 13.07.2013

Hello, how to make that an Vehicle have infinitely Health?


Re: Infinitely Vehicle Health - IceCube! - 13.07.2013

SetVehicleHealth(vehicleid, 9999999);

Or use OnVehicleDamageStatusUpdate, there place code to RepairVehicle(vehicleid); this will repair the car if it hits something including bodywork. However sometimes it called too late and the player ies anyway


AW: Infinitely Vehicle Health - Blackazur - 13.07.2013

And you cant make it otherwise, or with an other method or so?


AW: Infinitely Vehicle Health - Macronix - 13.07.2013

Do you want to make every vehicle to have infinite health or only specific vehicles, such as vehicles for players?


AW: Infinitely Vehicle Health - Blackazur - 13.07.2013

Just say me if there is a method to give an vehicle infinite health.


AW: Infinitely Vehicle Health - Macronix - 13.07.2013

You could make a timer, which calls the (specific) vehicle and set the vehicle health to 1000.0 everytime.

pawn Код:
SetTimer("SetCarGod", 1000, true);

forward SetCarGod();
public SetCarGod()
{
     for(new i; i < MAX_PLAYERS; i++)
     {
          if(IsPlayerInAnyVehicle(i))
          {
               SetVehicleHealth(GetPlayerVehicleID(i), 1000.0);
          }
     }
}