What's new

Solved IS_PLAYER_PRESSING_HORN

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

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Points
55
Sin$
7
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?
 
D

Deleted member 552650

Freeze Menu
Messages
756
Reaction score
415
Points
175
Sin$
0
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...........
 
Upvote 0
D

Deleted member 552650

Freeze Menu
Messages
756
Reaction score
415
Points
175
Sin$
0
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.......
 
Upvote 0
Mr Chip53

Mr Chip53

Enthusiast
Messages
582
Reaction score
200
Points
150
Sin$
0
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:
Upvote 0
X3TuRb0

X3TuRb0

Enthusiast
Messages
434
Reaction score
203
Points
135
Sin$
0
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.
 
Upvote 0
Nr 815195

Nr 815195

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

But now im not at home because im working
 
Upvote 0
E

Evil Blunt

Getting There
Platinum Record
Messages
958
Reaction score
1,491
Points
245
Sin$
7
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
 
Upvote 0
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Points
55
Sin$
7
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?
 
Upvote 0
Sinconic HD

Sinconic HD

Enthusiast
Messages
416
Reaction score
86
Points
105
Sin$
0
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.
 
Upvote 0
Nr 815195

Nr 815195

Enthusiast
Messages
78
Reaction score
12
Points
55
Sin$
7
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
 
Upvote 0
Top Bottom
Login
Register