LookAtPlayer
Jump to navigation
Jump to search
Description:
The function sets the angle of the npc, making it face the player.
Parameters:
(playerid)
playerid : The ID of the player the npc will face.
Return Values:
Returns true on success and false on failure (npc not spawned, npc inside vehicle, or target player not connected). Using npc ID as player id results in undefined behaviour.
Example
function OnPlayerText(playerid, message) { if(message=="lookAtMe") { if(GetDistanceFromMeToPoint(GetPlayerPos(playerid))<100.0) { LookAtPlayer(playerid); } } }
Related Functions
The following functions may be helpful as they relate to this function in one way or another.