Vehicle damage status - Lights & Panels
#1

Hello,

I'm scripting now a new repair system for my GM. It's clear for me the way tires and doors work, but... could somebody send me a link or explain the values returned when calling GetVehicleDamageStatus on Lights and Panels?

Thanks and kind regards,
Siralos
Reply
#2

Panels you mean?
I didn't clearly understand what you mean but if is this here is a stock coming with samp server at vehicleutils inside includes for Vehicle Lights
pawn Code:
stock ToggleVehicleLights(vid)
{
     new engine,lights,alarm,doors,bonnet,boot,objective;
     GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
     if(lights == VEHICLE_PARAMS_UNSET || lights == VEHICLE_PARAMS_OFF) SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
     else SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
}
Reply
#3

https://sampwiki.blast.hk/wiki/GetVehicleDamageStatus
Reply
#4

Hello,

What I need to understand is the meaning of these arguments returned by GetVehicleDamageStatus(vehicleid, &panels, &doors, &lights, &tires)

The integer to store the panel damage data in, passed by reference.
The integer to store the light damage data in, passed by reference.

If they return, for example: 150... What does that mean in terms of visualization of the car?

Tires and Doors are explained correctly in sa-mp wiki, but not lights or panels.

Thanks in advance and regards,
Siralos
Reply
#5

Anybody has every used this?
Thanks!
Reply
#6

Panels and Lights return 1 if damaged, or 0 if undamaged.
Reply
#7

Quote:
Originally Posted by clarencecuzz
View Post
Panels and Lights return 1 if damaged, or 0 if undamaged.
Thanks! So, no distinction among the right or left light; that's what I needed to know.

Regards,
Siralos
Reply
#8

To be honest, I'm not completely sure, but my guess is very small compared to what others may know. There should be a distinction between right and left, but I'm not sure how this function handles it. Sorry
Reply
#9

Quote:
Originally Posted by Siralos
View Post
Thanks! So, no distinction among the right or left light; that's what I needed to know.

Regards,
Siralos
Yes there is, they are stored in bits

Use this

pawn Code:
encode_lights(light1, light2, light3, light4)
{
    return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}
UpdateVehicleDamageStatus(vehicleid, panels, doors, encode_lights(0, 0, 0, 0), tires);
Reply
#10

Quote:
Originally Posted by Kar
View Post
Yes there is, they are stored in bits

Use this

pawn Code:
encode_lights(light1, light2, light3, light4)
{
    return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}
UpdateVehicleDamageStatus(vehicleid, panels, doors, encode_lights(0, 0, 0, 0), tires);
Thank you very much. What about panels?

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)