What's new

Solved IS_PLAYER_PRESSING_HORN

  • Thread starter Nr 815195
  • Start date
  • Views 555
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Hey im trying to check if a player press the horn but it dont works

native:
Code:
extern boolean IS_PLAYER_PRESSING_HORN(Player playerIndex);

i use this function to check this but its only printing when im horning
Code:
for(i = 0;i <= 16;i++){
     if(IS_PLAYER_PRESSING_HORN(i)){
           print("Horning");
     }
}



i find this thread http://www.se7ensins.com/forums/threads/new-mod-possible.836252/ but i dont understand this, did i must get the Network ID of the car bevor i can check the horn?
 
XF CH3WY

XF CH3WY

Freeze Menu
Messages
755
Reaction score
415
Hey im trying to check if a player press the horn but it dont works

native:
Code:
extern boolean IS_PLAYER_PRESSING_HORN(Player playerIndex);

i use this function to check this but its only printing when im horning
Code:
for(i = 0;i <= 16;i++){
     if(IS_PLAYER_PRESSING_HORN(i)){
           print("Horning");
     }
}



i find this thread http://www.se7ensins.com/forums/threads/new-mod-possible.836252/ but i dont understand this, did i must get the Network ID of the car bevor i can check the horn?
It's asking for a player id...........
 
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Yes and i give the id.....
 
XF CH3WY

XF CH3WY

Freeze Menu
Messages
755
Reaction score
415
Yes and i give the id.....
if you're using a menu you have to use players[index].id if you're not using a menu then you have to make your own array where it keeps the network players.......
 
XF CH3WY

XF CH3WY

Freeze Menu
Messages
755
Reaction score
415
Yes and i give the id.....
if you're using a menu you have to use players[index].id if you're not using a menu then you have to make your own array where it keeps the network players id.......
 
Mr Chip53

Mr Chip53

Enthusiast
Messages
582
Reaction score
200
if you're using a menu you have to use players[index].id if you're not using a menu then you have to make your own array where it keeps the network players id.......
No :asshat: the code he is using will work fine... Player IDs go from 0-15 so if he makes a loop from 0-15 it should work.

AT OP try using it on yourself(get in car and honk) if it doesnt work its possible the native may not function properly. But it should work as is

Just relized that you have i <= 16 change it to i < 16 and see if that helps... it may not but you never know

EDIT: Read it closer do you mean it only senses when YOU press the horn?
 
Last edited:
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Yes wenn i use the horn then works fine
 
Mr Chip53

Mr Chip53

Enthusiast
Messages
582
Reaction score
200
Yes wenn i use the horn then works fine
The native may not actually work as its supposed because obviously the code is correct. I dont know what to tell you.
 
X3TuRb0

X3TuRb0

Enthusiast
Messages
434
Reaction score
203
What exactly are you trying to do with this? Checking to see if another player is honking the horn wont work but i could probably help you find another way of doing whatever it is your doing.
 
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Can i add u on skype?
I will explain u what im try to make

But now im not at home because im working
 
Evil Blunt

Evil Blunt

Getting There
Platinum Record
Messages
958
Reaction score
1,489
I tried something with this before, i setup 16 bikes at the airport and if a player gets on one and presses the horn the bike launches forward, I had xkey tester try it out but it didnt work for him.
It should work tho and i dont think you need to get the networkid of the ped before they press the horn.

Heres the 16 bike sco if anyone wants to try. Press Back Button to activate.
Netplayer Force Test

Heres another sco just printing Player Pressing Horn to see if this does actually work.
Netplayer Horn Test
 
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Ok when im at home i test it with the network id of the ped, but is it possible to get the network id of a other player?
 
Sinconic HD

Sinconic HD

Enthusiast
Messages
416
Reaction score
86
I tried something with this before, i setup 16 bikes at the airport and if a player gets on one and presses the horn the bike launches forward, I had xkey tester try it out but it didnt work for him.
It should work tho and i dont think you need to get the networkid of the ped before they press the horn.

Heres the 16 bike sco if anyone wants to try. Press Back Button to activate.
Netplayer Force Test

Heres another sco just printing Player Pressing Horn to see if this does actually work.
Netplayer Horn Test
Do you have the source.
 
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
EvilB i test this now but it print this only when i press the horn

i will test it now with the networkid of the player
 
Top Bottom