Horn Key
#1

Hey,

Bey I'm trying to make it so when a cop press's the Horn key in a cop car A text draw will appear and say Emergency lights activated, The only Problem I have is that I dont know what the Key_ is for Horn and how to detect if its a cop car. The team and that I can do but yeah.

Any help is appreciated.
Reply
#2

its KEY_CROUCH
Reply
#3

There is no default define for a KEY_HORN id.

You can easily find the ID of the key yourself by making a simple system to print the ID of the keys when they are pressed in-game.

pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    printf("Newkeys: %d",newkeys);
    return 1;
}
Go in-game, make sure you're not pressing any buttons, then press the horn button, let go it, then look at your console or server_log.txt, and you will see the ID of the horn button printed in there.
Reply
#4

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
There is no default define for a KEY_HORN id.

You can easily find the ID of the key yourself by making a simple system to print the ID of the keys when they are pressed in-game.

pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    printf("Newkeys: %d",newkeys);
    return 1;
}
Go in-game, make sure you're not pressing any buttons, then press the horn button, let go it, then look at your console or server_log.txt, and you will see the ID of the horn button printed in there.
But cant KEY_CROUCH be used for Horn, cuz im using that.
Reply
#5

KEY_CROUCH is horn key , but if player is on foot it means key 'C'....
Reply
#6

Quote:
Originally Posted by ColdXX
Посмотреть сообщение
But cant KEY_CROUCH be used for Horn, cuz im using that.
Well sure if it has the same ID, although this method will find any key you want to use, if it is not in the definitions.
Reply
#7

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Well sure if it has the same ID, although this method will find any key you want to use, if it is not in the definitions.
Hey, Thanks for that
Reply
#8

Just pointing out that there is no dependable way to detect the sirens, I think. At least this is not.
What if player holds the horn key for a bit longer, instead of just pressing it for a moment?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)