Is there a way to check if the sirens have been enabled (Via beeping the horn)
#1

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!
Reply
#2

Make a bool and use OnPlayerKeyStateChange should do the trick.
Reply
#3

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!
Reply
#4

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

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

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

EDIT: It's KEY_CROUCH
Reply
#7

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

It's KEY_CROUCH
Reply
#9

No, KEY_CROUCH is the "c" key.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)