SA-MP Forums Archive
OnVehicleSirenStateChange bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: OnVehicleSirenStateChange bug (/showthread.php?tid=585751)



OnVehicleSirenStateChange bug - Dutheil - 16.08.2015

Well, OnVehicleSirenStateChange is called when the alarm is activated.
Is this normal ?


Re: OnVehicleSirenStateChange bug - Abagail - 16.08.2015

Most likely the client detects if the vehicle creates a sound, you can probably make a workaround by hooking OnVehicleSirenStateChange and calling it if the alarm isn't active.

pawn Код:
#include <a_samp>

public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
{
       new engine, lights, alarm, doors, bonnet, boot, objective;
       GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
   
       if(alarm)
       {
            return 1;
       }
   
    CallLocalFunction("FIX_OnVehicleSirenStateChange", "iii", playerid, vehicleid, newstate);
    return 1;
}

#if defined _ALS_OnVehicleSirenStateChange
  #undef OnVehicleSirenStateChange
#else
#define _ALS_OnVehicleSirenStateChange
#endif

#define OnVehicleSirenStateChange FIX_OnVehicleSirenStateChange

forward FIX_OnVehicleSirenStateChange(playerid, vehicleid, newstate);



Re : OnVehicleSirenStateChange bug - Dutheil - 16.08.2015

It is what I did

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Most likely the client detects if the vehicle creates a sound
No, because the horn does not call the callback.