MiscClient2 outputs

getProjectileOfProjectileTypeWithinDistance

GET_PROJECTILE_OF_PROJECTILE_TYPE_WITHIN_DISTANCE0x82FDE6A57EE4EE44

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

SignatureJavaScript
getProjectileOfProjectileTypeWithinDistance(
  ped: Ped,
  weaponHash: Hash,
  distance: number,
  p5: boolean
): [
  ok: boolean,
  outCoords: { x: number, y: number, z: number },
  outProjectile: Object
]
SignatureLua
getProjectileOfProjectileTypeWithinDistance(
  ped: Ped,
  weaponHash: Hash,
  distance: number,
  p5: boolean
): boolean, Vector3, Object

Usage

JavaScript
const [ok, outCoords, outProjectile] =
  getProjectileOfProjectileTypeWithinDistance(ped, weaponHash, distance, p5);
Lua
local ok, outCoords, outProjectile =
    getProjectileOfProjectileTypeWithinDistance(ped, weaponHash, distance, p5)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
distancefloatnumbernumber
p5BOOLbooleanboolean

Returns

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

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

Reference

Namespace
Misc MISC
In the game
BOOL GET_PROJECTILE_OF_PROJECTILE_TYPE_WITHIN_DISTANCE(Ped ped, Hash weaponHash, float distance, Vector3* outCoords, Object* outProjectile, BOOL p5)
Hash
0x82FDE6A57EE4EE44
Formerly
_GET_PROJECTILE_NEAR_PED

Open in the interactive natives reference