SetMyFacingAngle

From NPC for VCMP 0.4 Servers
Revision as of 15:16, 18 March 2022 by 137.97.114.225 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Description:
Sets the facing angle of an NPC


Parameters:

(angle)

angle : The new angle (in radians) for the NPC.


Return Values:
This function does not return any specific values.


Example

function OnPlayerText(playerid, message)
{
	if(message=="lookatme")
	{
		local pos=GetPlayerPos(playerid);local mypos=GetMyPos();
		local angle=atan2(-(pos.x-mypos.x),pos.y-mypos.y)
		SetMyFacingAngle(angle);
	}
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.