GetPlayerTargetActor
From SA-MP Wiki
Description:
Gets id of an actor which is aimed by certain player.
(playerid)
playerid | The ID of the player to get the target of. |
Return Values:
The ID of the targeted actor, or INVALID_ACTOR_ID if none.
Important |
|
Example Usage:
public OnPlayerUpdate(playerid) { new actorid = GetPlayerTargetActor(playerid); new string[32]; format(string, sizeof(string), "You are aiming at actor id %d", actorid); SendClientMessage(playerid, -1, string); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetPlayerCameraTargetActor: Get the ID of the actor (if any) a player is looking at.
- GetPlayerCameraFrontVector: Get the player's camera front vector
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerGiveDamageActor: This callback is called when a player gives damage to an actor.