WeaponClient

getBestPedWeapon

GET_BEST_PED_WEAPON0x8483E98E8B888AE2

The GTA V native GET_BEST_PED_WEAPON of the WEAPON namespace, as LS:MP client scripts call it: the global function getBestPedWeapon, in JavaScript and in Lua.

SignatureJavaScript
getBestPedWeapon(ped: Ped, bIgnoreAmmoCheck: boolean): Hash
SignatureLua
getBestPedWeapon(ped: Ped, bIgnoreAmmoCheck: boolean): Hash

Usage

JavaScript
const hash = getBestPedWeapon(ped, bIgnoreAmmoCheck);
Lua
local hash = getBestPedWeapon(ped, bIgnoreAmmoCheck)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
bIgnoreAmmoCheckBOOLbooleanboolean

Returns

Hash JavaScript number, Lua integer

A game hash. Natives return it unsigned (0 to 4294967295), the value lsmp.hash gives. As an argument, the signed and unsigned forms of a hash are the same value.

Notes

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

bIgnoreAmmoCheck is always false in the scripts.

Reference

Namespace
Weapon WEAPON
In the game
Hash GET_BEST_PED_WEAPON(Ped ped, BOOL bIgnoreAmmoCheck)
Hash
0x8483E98E8B888AE2

Open in the interactive natives reference