Quote:
Originally Posted by Smileys
Nice work, optimized the code a lil bit for you.
NOTE: it's untested, but it should work, can't test it right now but should work fine.
pawn Code:
forward OnLightFlash(vehicleid);
public OnLightFlash(vehicleid) { new panels, doors, lights, tires; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
new states[ 3 ] = { 2, 4, 5 };
new currstate = states[ random( 3 ) ];
UpdateVehicleDamageStatus( vehicleid, panels, doors, currstate, tires ); return 1; }
|
that won't be consistant though (For example, you might get the same random 4 times and that light would stay lit)
I did it that way to change states every 115ms, in the following pattern: left, off, left, right, off, right