RedM Natives

_GET_BEST_PED_WEAPON_IN_INVENTORY

Hash0x7B98500614C8E8B8
Runtime nameGetBestPedWeaponInInventory
NamespaceWEAPON
SideClient
NameCommunity guess
Docs
Since build1232

Signature

Any _GET_BEST_PED_WEAPON_IN_INVENTORY(Ped ped, Any p1, Any* guidPrimary);

Parameters

NameTypeDescription
pedPed—
p1Any—
guidPrimaryAny*—

Returns Any

Usage

Lua
local retval, guidPrimary = GetBestPedWeaponInInventory(ped, p1, guidPrimary)

-- always works, by hash
local retval, guidPrimary = Citizen.InvokeNative(0x7B98500614C8E8B8, ped, p1, Citizen.PointerValueIntInitialized(guidPrimary), Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, guidPrimary] = GetBestPedWeaponInInventory(ped, p1, guidPrimary);

// by hash
const [retval, guidPrimary] = Citizen.invokeNative('0x7B98500614C8E8B8', ped, p1, Citizen.pointerValueIntInitialized(guidPrimary), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var guidPrimary = new OutputArgument();
int retval = Function.Call<int>((Hash)0x7B98500614C8E8B8, ped, p1, guidPrimary);
// guidPrimary.GetResult<int>()
  • The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.