FireClient1 output

getClosestFirePos

GET_CLOSEST_FIRE_POS0x352A9F6BCF90081F

The GTA V native GET_CLOSEST_FIRE_POS of the FIRE namespace, as LS:MP client scripts call it: the global function getClosestFirePos, in JavaScript and in Lua.

SignatureJavaScript
getClosestFirePos(x: number, y: number, z: number): [
  ok: boolean,
  outPosition: { x: number, y: number, z: number }
]
SignatureLua
getClosestFirePos(x: number, y: number, z: number): boolean, Vector3

Usage

JavaScript
const [ok, outPosition] = getClosestFirePos(x, y, z);
Lua
local ok, outPosition = getClosestFirePos(x, y, z)

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
const [ok, outPosition] = getClosestFirePos(pos);
Lua · with vectors
local ok, outPosition = getClosestFirePos(pos)

Parameters

ParameterTypeJavaScriptLua
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1okBOOLbooleanbooleanThe native’s own return value.
2outPositionVector3{ x: number, y: number, z: number }Vector3output

Notes

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

Returns TRUE if it found something. FALSE if not.

Reference

Namespace
Fire FIRE
In the game
BOOL GET_CLOSEST_FIRE_POS(Vector3* outPosition, float x, float y, float z)
Hash
0x352A9F6BCF90081F

Open in the interactive natives reference