[BUG] OnVehicleSirenStateChange caught in infinite loop
#2

This happens because the "alarm" parameter in SetVehicleParamsEx is bound to the siren (if you toggle an alarm on a cop car, it toggles its siren). What you can do is store the state of car's siren and then compare the old state to the new one and only call the function when there's a change between the values, because right now it goes:

Siren on -> OnVehicleSirenStateChange -> Toggles siren on -> Siren on -> OnVehicleSirenStateChange -> ...
Reply


Messages In This Thread
[BUG] OnVehicleSirenStateChange caught in infinite loop - by MP2 - 18.04.2015, 00:15
Re: [BUG] OnVehicleSirenStateChange caught in infinite loop - by Mmartin - 18.04.2015, 15:27
Re: [BUG] OnVehicleSirenStateChange caught in infinite loop - by Kalcor - 18.04.2015, 15:51
Re: [BUG] OnVehicleSirenStateChange caught in infinite loop - by MP2 - 18.04.2015, 16:56

Forum Jump:


Users browsing this thread: 1 Guest(s)