• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Checking aiming data real-time
#3
(2020-12-20, 08:05 PM)Eloctro Wrote:
Code:
new actorid = GetPlayerTargetActor(playerid);


More or less. NPC's are considered players by the server.

In order to get the ID of the NPC a player is aiming to, use GetPlayerTargetPlayer(playerid);


Furthermore, in order for either of these two functions to work, you'll have to enable the following inside OnPlayerConnect:

Code:
EnablePlayerCameraTarget(playerid, 1);

This is disabled by default to save bandwidth, but isn't really a problem in the last decade.
  Reply


Messages In This Thread
Checking aiming data real-time - by c4p - 2020-12-20, 06:11 PM
RE: Checking aiming data real-time - by Eloctro - 2020-12-20, 08:05 PM
RE: Checking aiming data real-time - by Markski - 2020-12-20, 10:18 PM
RE: Checking aiming data real-time - by c4p - 2020-12-24, 07:02 PM
RE: Checking aiming data real-time - by Pinch - 2020-12-24, 10:23 PM
RE: Checking aiming data real-time - by c4p - 2020-12-25, 02:58 PM
RE: Checking aiming data real-time - by Pinch - 2020-12-25, 04:27 PM
RE: Checking aiming data real-time - by c4p - 2020-12-25, 04:34 PM

Forum Jump: