SA-MP Forums Archive
Is there a way to check if the sirens have been enabled (Via beeping the horn) - 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: Is there a way to check if the sirens have been enabled (Via beeping the horn) (/showthread.php?tid=275701)



Is there a way to check if the sirens have been enabled (Via beeping the horn) - Redgie - 10.08.2011

If you get in a police car and turn the engine on (Manual engine etc) the alarm (Siren) will be at 0. If you then turn the alarm to 1 manually using setvehicleparamsex then the alarm will change to 1.

However, if you get in a cop car and turn the siren on by using the horn, the value for the alarm stays at 0. How can you go about finding out the current alarm (Siren) state of a car if SA:MP does not track when you enable sirens via beeping the horn? Am I missing some other command here that will help?

Thanks!


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - =WoR=Varth - 10.08.2011

Make a bool and use OnPlayerKeyStateChange should do the trick.


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - omer5198 - 10.08.2011

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Make a bool and use OnPlayerKeyStateChange should do the trick.
b.t.w: if you don't know (Redgie) bool is like a variable but you can only change it from 0 -> 1 or from 1 -> 0...
(bool = a Var that can be only 1/0)
hope i helped!


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - Redgie - 10.08.2011

But the keystatechange only detects the use, it doesn't detect whether or not it actually activates the siren.


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - Scenario - 10.08.2011

Actually, according to this page the horn key can't be identified through SA-MP.


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - =WoR=Varth - 10.08.2011

So use GetTickCount. Check if player press the horn button longer than 1 second(I guess).

EDIT: It's KEY_CROUCH


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - Redgie - 10.08.2011

As stated above, the horn is not a registered button that can be detected.


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - =WoR=Varth - 10.08.2011

It's KEY_CROUCH


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - Scenario - 10.08.2011

No, KEY_CROUCH is the "c" key.


Re: Is there a way to check if the sirens have been enabled (Via beeping the horn) - =WoR=Varth - 10.08.2011

Some key have a same value, but different button depend on the player state.