SA-MP Forums Archive
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: Vehicle Health (/showthread.php?tid=464227)



Vehicle Health - Drago987 - 15.09.2013

Hello ,i just wanted to ask if there is anyway to set the vehicles health so i can set the PD Factions health from 1000 to any other value ,i saw a lot of other server doing it ,so if you know how ,post it please


Re: Vehicle Health - EiresJason - 15.09.2013

Use this function.

pawn Код:
SetVehicleHealth(vehicleid, Float:health);
So for example; if you have something like this under OnGameModeInit().
pawn Код:
LSPDCar[0] = CreateVehicle(relevant data);
You can set that vehicle's health to 10000 if you do this;
pawn Код:
SetVehicleHealth(LSPDCar[0], 10000);



Re: Vehicle Health - Drago987 - 15.09.2013

i only found this
pawn Код:
LSPDVehicles[0] = AddStaticVehicleEx(596,1602.0660,-1683.9678,5.6124,90.3080,0,1, VEHICLE_RESPAWN);
what should i do to change the health of it ?


Re: Vehicle Health - Eyce - 15.09.2013

Change it to
pawn Код:
LSPDVehicles[0] = CreateVehicle(596, 1602.0660, -1683.9678, 5.6124, 90.3080, 0, 1, VEHICLE_RESPAWN);
Then set the health
pawn Код:
SetVehicleHealth(LSPDVehicles[0], 10000);



Re: Vehicle Health - Scrillex - 15.09.2013

SetVehicleHealth(LSPDVehicles[0], 10000);

UnderGamemodeInit


Re: Vehicle Health - Drago987 - 16.09.2013

Thanks for helping guys ,i got it working now