Posts: 882
Threads: 50
Joined: Jun 2012
Reputation:
0
GetPlayerTargetPlayer(playerid)
Doesn't work with sniper no matter how close or far away you are!
Doesn't work even when I am just a unit away from the player.
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
That's because sniper's don't lock on to the player(and the green target indicator isn't there). This only returns a player if a green target indicating is showing.
Posts: 263
Threads: 11
Joined: Nov 2014
It's still a bug if it dosen't work for snipers ph.
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
It's not a bug the PLAYER IS NOT TARGETED! There is no internal mechanism that does this like the the other weapons get it through your head you can't get a targeted player if no player is targeted.
Posts: 1,099
Threads: 79
Joined: Nov 2011
Reputation:
0
It's not a bug, but is it sad that we can't know if a player is targeting a player with a sniper or not, yes it is!
Although, you can do some vectoral checks and know if the player is targeting a player with their sniper. But this requires checks at the server side, would it be better if we had functions to do it? Yes it would be!
Posts: 2,181
Threads: 98
Joined: Jan 2011
Reputation:
0
There is a function since 0.3.7 called GetPlayerCameraTargetPlayer
It returns the player that you're looking at. Give it a try for snipers!
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by Yashas
Doesn't work even if I am 5 units away from the player.
|
GetPlayerTargetPlayer or GetPlayerCameraTargetPlayer, sniper or no sniper. Explain your procedure.