Police blinking lights. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread:  Police blinking lights. (
/showthread.php?tid=506681)
 
Police blinking lights. - 
cuemur -  13.04.2014
https://www.youtube.com/watch?v=Ojrpnx7cq6I
I need something like in video.
pawn Код:
public FlasherFunc() {
        new panelsx,doorsx,lightsx,tiresx;
        for (new p=0; p<MAX_VEHICLES; p++)
        {
                if (Flasher[p] == 1)
                {
                        if (FlasherState[p] == 1)
                        {
                                GetVehicleDamageStatus(p,panelsx,doorsx,lightsx,tiresx);
                                UpdateVehicleDamageStatus(p, panelsx, doorsx, 4, tiresx);
                                FlasherState[p] = 0;
                        }
                        else
                        {
                                GetVehicleDamageStatus(p,panelsx,doorsx,lightsx,tiresx);
                                UpdateVehicleDamageStatus(p, panelsx, doorsx, 1, tiresx);
                                FlasherState[p] = 1;
                        }
                }
        }
        return 1;
}
 
Re: Police blinking lights. - 
DobbysGamertag -  13.04.2014
That looks like ELM or something in the video. Does your code not work?
Re: Police blinking lights. - 
Chenko -  13.04.2014
As DobbysGamertag said the flashing headlights you are seeing is a mod called ELM. It can't be scripted in your gamemode.
Re: Police blinking lights. - 
tyler12 -  13.04.2014
pawn Код:
#define BLINK_LEFT_LIGHT 0
#define BLINK_RIGHT_LIGHT 1
new Flasher[MAX_VEHICLES],FlasherState[MAX_VEHICLES];
forward public FlasherFunc();
public FlasherFunc()
{
    new panelsx,doorsx,lightsx,tiresx;
    for(new i; i < MAX_VEHICLES; i++)
    {
        if(Flasher[i] == 1)
        {
            if(FlasherState[i] == BLINK_LEFT_LIGHT)
            {
                GetVehicleDamageStatus(i,panelsx,doorsx,lightsx,tiresx);
                UpdateVehicleDamageStatus(i,panelsx,doorsx,2,tiresx);
                FlasherState[i] = BLINK_RIGHT_LIGHT;
            }
            else if(FlasherState[i] == BLINK_RIGHT_LIGHT)
            {
                GetVehicleDamageStatus(i,panelsx,doorsx,lightsx,tiresx);
                UpdateVehicleDamageStatus(i,panelsx,doorsx,8,tiresx);
                FlasherState[i] = BLINK_LEFT_LIGHT;
            }
        }
    }
    return 1;
}