setPedAimTarget | Multi Theft Auto: Wiki Skip to content

setPedAimTarget

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function allows you to set a ped's aim target to a specific point. If a ped is within a certain range defined by getPedTargetStart and getPedTargetEnd he will be targeted and shot.

Syntax

setPedAimTarget ( )

Code Examples

client

Example 1:This example creates a ped in the middle of the map and sets its aim target to point north-east.

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