OnVehicleSirenStateChange bug
#1

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

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);
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)