Could someone explain vehicle light 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: Could someone explain vehicle light damage? (
/showthread.php?tid=573814)
Could someone explain vehicle light damage? -
Dokins - 10.05.2015
I plan to make a flash system, but I'm not sure how the damage is stored? If I wanted to fix the front right light for instance, what would I do to update it/get which is damage?
pawn Код:
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tyres);
Re: Could someone explain vehicle light damage? -
Affan - 10.05.2015
Код:
UpdateVehicleDamageStats(vehicleid, panels, doors, 1, tyres);
Re: Could someone explain vehicle light damage? -
Dokins - 10.05.2015
Yes, but how do I know which is which etc?
Re: Could someone explain vehicle light damage? -
Abagail - 10.05.2015
Use JerneJ's encode_lights function:
encode_lights(0, 0, 0, 0);
I am not sure exactly what the positions of them are, but you can easily mess around with it and find out for yourself ingame.
pawn Код:
encode_lights(light1, light2, light3, light4)
{
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}
e.g:
pawn Код:
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, encode_lights(0,0,0,1), tires);
Re: Could someone explain vehicle light damage? -
Dokins - 10.05.2015
Thank you very much!
Re: Could someone explain vehicle light damage? -
Affan - 10.05.2015
Unfortunately you can only check tires and doors.
https://sampwiki.blast.hk/wiki/TireStates
https://sampwiki.blast.hk/wiki/DoorStates
Edit: Nevermind. lol