Thread: [FilterScript] [0.3.7] Flashing Police Lights (ELM)
View Single Post
Old 23/04/2015, 08:10 PM   #3
Smileys
Huge Clucker
 
Smileys's Avatar
 
Join Date: Dec 2013
Location: Home.
Posts: 394
Reputation: 31
Default Re: [0.3.7] Flashing Police Lights (ELM)

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;
}
Smileys is offline   Reply With Quote