Toggle individual vehicle lights

Started by Murdock, Mar 25, 2020, 11:45 PM

Previous topic - Next topic

Murdock

Small snippet to turn each vehicle light on or off

enum VehicleLights {
    HeadLeft    = 0x1,
    HeadRight   = 0x4,
    TailLeft    = 0x10,
    TailRight   = 0x40,
    TaxiLight   = 0x100
}

function setLights(vehicle, lightId, isVisible)
{
    if (isVisible) vehicle.LightFlags = vehicle.LightFlags & (~lightId);
    else vehicle.LightFlags = vehicle.LightFlags | lightId;
}

// Usage:
setLights( vehicle, VehicleLights.TailLeft, true );
setLights( vehicle, VehicleLights.TailRight, false );

Sebastian


=RK=MarineForce

nice but we can do it in newtimer?

i mean newtimer after 0.10 seconds

light on or off?
Try to UnderStand ME!

NicusorN5

Quote from: =RK=MarineForce on Mar 26, 2020, 07:51 AMnice but we can do it in newtimer?

i mean newtimer after 0.10 seconds

light on or off?
What do you see in the picture?