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



Check Vehicle's Health - FishyZ - 07.09.2014

How do I make check the script help, and if it's less than 250, It will make the car engine shutdown and say 'Engine's vehicle is dead'


I'm new to scripting so please help me!


Re: Check Vehicle's Health - FishyZ - 07.09.2014

Bump.. Help please?


Re: Check Vehicle's Health - Kyance - 07.09.2014

https://sampwiki.blast.hk/wiki/GetVehicleHealth + https://sampwiki.blast.hk/wiki/SetVehicleParamsEx



Re: Check Vehicle's Health - dusk - 07.09.2014

pawn Код:
new Float:hp;
GetVehicleHealth(vehicleid, hp);
if(hp < 250)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
   GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
    SendClientMessage(playerid,0x00FF00FF,"Engine is dead. Have a nice life.");
}
And you shouldn't bump topics so soon.