MiscClient

isProjectileTypeWithinDistance

IS_PROJECTILE_TYPE_WITHIN_DISTANCE0x34318593248C8FB2

The GTA V native IS_PROJECTILE_TYPE_WITHIN_DISTANCE of the MISC namespace, as LS:MP client scripts call it: the global function isProjectileTypeWithinDistance, in JavaScript and in Lua.

SignatureJavaScript
isProjectileTypeWithinDistance(
  x: number,
  y: number,
  z: number,
  projectileHash: Hash,
  radius: number,
  ownedByPlayer: boolean
): boolean
SignatureLua
isProjectileTypeWithinDistance(
  x: number,
  y: number,
  z: number,
  projectileHash: Hash,
  radius: number,
  ownedByPlayer: boolean
): boolean

Usage

JavaScript
const result = isProjectileTypeWithinDistance(x, y, z, projectileHash, radius, ownedByPlayer);
Lua
local result = isProjectileTypeWithinDistance(x, y, z, projectileHash, radius, ownedByPlayer)

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 result = isProjectileTypeWithinDistance(pos, projectileHash, radius, ownedByPlayer);
Lua · with vectors
local result = isProjectileTypeWithinDistance(pos, projectileHash, radius, ownedByPlayer)

Parameters

ParameterTypeJavaScriptLua
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
projectileHashHashnumberinteger
radiusfloatnumbernumber
ownedByPlayerBOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Reference

Namespace
Misc MISC
In the game
BOOL IS_PROJECTILE_TYPE_WITHIN_DISTANCE(float x, float y, float z, Hash projectileHash, float radius, BOOL ownedByPlayer)
Hash
0x34318593248C8FB2
Formerly
_IS_PROJECTILE_TYPE_IN_RADIUS

Open in the interactive natives reference