SA-MP Forums Archive
[BUG] Vehicle Alarm not reset! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [BUG] Vehicle Alarm not reset! (/showthread.php?tid=194098)



[BUG] Vehicle Alarm not reset! - DVDK - 28.11.2010

When you set the vehicle alarm to 1, and wait untill it ends, it will still show it as 1 if you use GetVehicleParamsEx.


Re: [BUG] Vehicle Alarm not reset! - The_Moddler - 28.11.2010

Just set a timer..


Re: [BUG] Vehicle Alarm not reset! - DVDK - 28.11.2010

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
Just set a timer..
I know i'm not stupid, it's a bug.


Re: [BUG] Vehicle Alarm not reset! - Kalcor - 28.11.2010

It's not a bug. You need to disable it yourself.


Re: [BUG] Vehicle Alarm not reset! - DVDK - 28.11.2010

Quote:
Originally Posted by Kalcor
Посмотреть сообщение
It's not a bug. You need to disable it yourself.
But it kinda is in some way, because if you check the vehicle alarm it says it's on but it isn't, so that's incorrect, so that's a bug.

So now we cannot just use the standard SetVehicleParamsEx but we have to use this?

pawn Код:
new Timer_VehAlarm[MAX_VEHICLES];
SetVehicleParamsEx_Fixed(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective)
{
    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(alarm){
    KillTimer(Timer_VehAlarm[vehicleid]);
    Timer_VehAlarm[vehicleid] = SetTimerEx("DisableVehicleAlarm", 20000, false, "d", vehicleid);}
}

forward DisableVehicleAlarm(vehicleid);
public DisableVehicleAlarm(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, engine, lights, false, doors, bonnet, boot, objective);
}



Re: [BUG] Vehicle Alarm not reset! - Grim_ - 28.11.2010

You got it, just no need to make the variable to hold the timer's ID - Unless you plan on destroying the timer for some reason.


Re: [BUG] Vehicle Alarm not reset! - DVDK - 28.11.2010

Quote:
Originally Posted by Grim_
Посмотреть сообщение
You got it, just no need to make the variable to hold the timer's ID - Unless you plan on destroying the timer for some reason.
Yes there is, because if they start the alarm again, it will stop too early.


Re: [BUG] Vehicle Alarm not reset! - Grim_ - 28.11.2010

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Unless you plan on destroying the timer for some reason.
The message you have entered is too short. Please lengthen your message to at least 8 characters


Re: [BUG] Vehicle Alarm not reset! - whitedragon - 28.11.2010

Wtf? i just not turn it off and it stops itself:S (25 sec)


Re: [BUG] Vehicle Alarm not reset! - Grim_ - 28.11.2010

Yes, it automatically turns off.

If you want it to continue playing, (I'm sure this will work) set a timer every 25 seconds re-applying the settings (Putting the alarm status to on again)