24.03.2010, 17:23
pawn Код:
stock VehicleLights(vehicleid, bool:status) // By Norn
{
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
if(status == true) lights = encode_lights(1, 1, 1, 1); else lights = encode_lights(0, 0, 0, 0);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
return 1;
}
stock encode_lights(light1, light2, light3, light4) {
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}
pawn Код:
VehicleLights(vehicleid, true);
pawn Код:
VehicleLights(vehicleid, false);
Works best with a timer.