SetPedAimTarget: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 20: Line 20:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function createPedAndsetHisAimTarget ()
function createPedAndsetHisAimTarget ()
         createPed (0, 0, 0, 5 ) -- create a ped, who looks like cj, in the middle of the map
         local ped = createPed (0, 0, 0, 5 ) -- create a ped, who looks like cj, in the middle of the map
         setPedAimTarget ( ped, 10, 10, 5 ) -- set the ped's target to a point in North-East
         setPedAimTarget ( ped, 10, 10, 5 ) -- set the ped's target to a point in North-East
end
end

Revision as of 13:38, 22 May 2009

This function allows you to set a ped's aim target to a specific point.

Syntax

bool setPedAimTarget ( ped thePed, float x, float y, float z )

Required Arguments

  • thePed: The ped whose target you want to set.
  • x: The x coordinate of the aim target point.
  • y: The y coordinate of the aim target point.
  • z: The z coordinate of the aim target point.

Returns

Returns true if the function was successful, false otherwise.

Example

function createPedAndsetHisAimTarget ()
        local ped = createPed (0, 0, 0, 5 ) -- create a ped, who looks like cj, in the middle of the map
        setPedAimTarget ( ped, 10, 10, 5 ) -- set the ped's target to a point in North-East
end

See Also