Car tottaled system - 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: Car tottaled system (
/showthread.php?tid=439880)
Car tottaled system -
OmarT2 - 27.05.2013
I have a RP server and it dosent have system that when the car is heavy damaged it say car totaled , Can someone give me a FS or tell me how to do it ?
AW: Car tottaled system -
Harry :) - 27.05.2013
Код:
public OnVehicleDamageStatusUpdate(vehicleid,playerid)
{
if(GetVehicleHealth(vehicleid) < 400)
{
SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,0); //Turns Engine and Lights off.
SendClientMessage(playerid,0xFF0000FF,"Your vehicle is totally damaged, it wont work from now on.");
}
return 1;
}
That's for a crash etc. of course, just showing you an example.
Re: Car tottaled system -
OmarT2 - 28.05.2013
Thanks for help
Re: Car tottaled system -
Pottus - 28.05.2013
OnVehicleDamageStatusUpdate() is not reliable for this.
https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate
"This callback is called when a vehicle element such as doors, tires, panels, or lights get damaged."
It might not always been called when you need it but there are other ways.
This seems like a job for a timer and foreach() with a custom iterator.