Toggle individual vehicle lights

Murdock

  • LU Beta Tester
  • Posts: 244
Toggle individual vehicle lights
«  »Last edited
Small snippet to turn each vehicle light on or off

Code: [Select]
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

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,067

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 475
Try to UnderStand ME!

Athanatos

  • Hero Member
  • sin^2(x)+cos^2(x) = 1
  • Posts: 915
Infected City Survival Main Dev