23.04.2015, 19:10
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.
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;
}