TasksClient

taskShootAtCoord

TASK_SHOOT_AT_COORD0x46A6CC01E0826106

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

SignatureJavaScript
taskShootAtCoord(
  ped: Ped,
  x: number,
  y: number,
  z: number,
  duration: number,
  firingPattern: Hash
): void
SignatureLua
taskShootAtCoord(
  ped: Ped,
  x: number,
  y: number,
  z: number,
  duration: integer,
  firingPattern: Hash
)

Usage

JavaScript
taskShootAtCoord(ped, x, y, z, duration, firingPattern);
Lua
taskShootAtCoord(ped, x, y, z, duration, firingPattern)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
taskShootAtCoord(ped, pos, duration, firingPattern);
Lua · with vectors
taskShootAtCoord(ped, pos, duration, firingPattern)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
durationintnumberinteger
firingPatternHashnumberinteger

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.

Firing Pattern Hash Information: https://pastebin.com/Px036isB

Reference

Namespace
Tasks TASK
In the game
void TASK_SHOOT_AT_COORD(Ped ped, float x, float y, float z, int duration, Hash firingPattern)
Hash
0x46A6CC01E0826106

Open in the interactive natives reference