GetPlayerCameraTargetPlayer

GetPlayerCameraTargetPlayer

Description:
Function GetPlayerCameraTargetPlayer retrieve the ID of the player the playerid is looking at.
Function GetPlayerCameraTargetPlayer was added in 0.3.7 and will not work in earlier versions!
This function is disabled by default to save bandwidth. Use EnablePlayerCameraTarget to enable it for each player.
Do not confuse this function with GetPlayerTargetPlayer. GetPlayerTargetPlayer returns the ID of the player playerid is aming at (with a weapon). GetPlayerCameraTargetPlayer returns the ID of the player playerid is looking at (reference point is the center of the screen).


Parameters:
(playerid)
int playerid The ID of the player to check.


Return Values:
The ID of the player the playerid is looking at.


Examples:
new playerTarget = GetPlayerCameraTargetPlayer(playerid);
 
if(IsPlayerAdmin(playerTarget))
{
    GameTextForPlayer(playerid, "Looking at an admin", 3000, 3);
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.