(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.