SetPedLookAt: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000, element target ] )
bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000, int blend = 1000, element target ] )
</syntaxhighlight>
</syntaxhighlight>


Line 17: Line 17:
===Optional Arguments===
===Optional Arguments===
*'''time:''' the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.
*'''time:''' the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.
*'''blend:''' the time, in milliseconds, during which the look will blend.
*'''target:''' if this argument is specified, the position arguments will be ignored and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.
*'''target:''' if this argument is specified, the position arguments will be ignored and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.


==See Also==
==See Also==
{{Client ped functions}}
{{Client ped functions}}

Revision as of 14:16, 21 August 2012

Accessories-text-editor.png Script Example Missing Function SetPedLookAt needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

Makes a ped turn his head and look at a specific world position or element.

Syntax

bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000, int blend = 1000, element target ] )

Required Arguments

  • thePed: the ped to change the lookat of.
  • x: the x coordinate of the world position to look at.
  • y: the y coordinate of the world position to look at.
  • z: the z coordinate of the world position to look at.

Optional Arguments

  • time: the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.
  • blend: the time, in milliseconds, during which the look will blend.
  • target: if this argument is specified, the position arguments will be ignored and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.

See Also