SA-MP Forums Archive
How to detect vehicle damage - 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: How to detect vehicle damage (/showthread.php?tid=394735)



How to detect vehicle damage - jakejohnsonusa - 23.11.2012

I would like to add to my GM that if a player is in a vehicle and crashes (looses at least 5 vehicle hp) the player in the vehicle looses 10 health points. How would I detect if the vehicle crashes (and looses at least 5hp)?

Thanks: jakejohnsonusa


Re: How to detect vehicle damage - park4bmx - 23.11.2012

you can check the sate of the vehicle with GetVehicleDamageStatus

or to get the HP when its hit use: public OnVehicleDamageStatusUpdate
then from there just check the HP


Re: How to detect vehicle damage - jakejohnsonusa - 23.11.2012

Thanks +1 Rep.