LookAtPos: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome| desc=This function sets the angle of npc such that it looks at the position given| params=<syntaxhighlight lang="lua"> pos</syntaxhighlight> <poem>::pos : The Vector position to which npc must look</poem>| example= The following code makes to look at player with ID 0. <source lang="lua"> LookAtPos(GetPlayerPos(0))</source>| relfuncs=*LookAtPlayer| retvals=true on success and false on failure (npc not spawned or npc is in vehicle.| }}")
 
No edit summary
 
Line 9: Line 9:
LookAtPos(GetPlayerPos(0))</source>|
LookAtPos(GetPlayerPos(0))</source>|
relfuncs=*[[LookAtPlayer]]|
relfuncs=*[[LookAtPlayer]]|
retvals=true on success and false on failure (npc not spawned or npc is in vehicle.|
retvals=true on success and false on failure (npc not spawned or npc is in vehicle).|
}}
}}

Latest revision as of 16:58, 29 October 2024


Description:
This function sets the angle of npc such that it looks at the position given


Parameters:

pos

pos : The Vector position to which npc must look


Return Values:
true on success and false on failure (npc not spawned or npc is in vehicle).


Example The following code makes to look at player with ID 0.

LookAtPos(GetPlayerPos(0))

Related Functions

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