TasksClient

taskGotoEntityAiming

TASK_GOTO_ENTITY_AIMING0xA9DA48FAB8A76C12

The GTA V native TASK_GOTO_ENTITY_AIMING of the TASK namespace, as LS:MP client scripts call it: the global function taskGotoEntityAiming, in JavaScript and in Lua.

SignatureJavaScript
taskGotoEntityAiming(
  ped: Ped,
  target: Entity,
  distanceToStopAt: number,
  StartAimingDist: number
): void
SignatureLua
taskGotoEntityAiming(
  ped: Ped,
  target: Entity,
  distanceToStopAt: number,
  StartAimingDist: number
)

Usage

JavaScript
taskGotoEntityAiming(ped, target, distanceToStopAt, StartAimingDist);
Lua
taskGotoEntityAiming(ped, target, distanceToStopAt, StartAimingDist)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
targetEntitynumberinteger
distanceToStopAtfloatnumbernumber
StartAimingDistfloatnumbernumber

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

eg

taskGotoEntityAiming(v_2, playerPedId(), 5.0, 25.0);

ped = Ped you want to perform this task.
target = the Entity they should aim at.
distanceToStopAt = distance from the target, where the ped should stop to aim.
StartAimingDist = distance where the ped should start to aim.

Reference

Namespace
Tasks TASK
In the game
void TASK_GOTO_ENTITY_AIMING(Ped ped, Entity target, float distanceToStopAt, float StartAimingDist)
Hash
0xA9DA48FAB8A76C12

Open in the interactive natives reference