Could someone explain vehicle light damage?
#1

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);
Reply
#2

Код:
UpdateVehicleDamageStats(vehicleid, panels, doors, 1, tyres);
Reply
#3

Yes, but how do I know which is which etc?
Reply
#4

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);
Reply
#5

Thank you very much!
Reply
#6

Unfortunately you can only check tires and doors.

https://sampwiki.blast.hk/wiki/TireStates
https://sampwiki.blast.hk/wiki/DoorStates

Edit: Nevermind. lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)