RedM Natives

GET_SELECTED_PED_WEAPON

An alias of GET_CURRENT_PED_WEAPON.

Hash0xD240123E
Runtime nameGetSelectedPedWeapon
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

Hash GET_SELECTED_PED_WEAPON(Ped ped);

Parameters

NameTypeDescription
pedPed

The target ped.

Returns Hash — The weapon hash.

Description

Cfx.re native reference

An alias of GET_CURRENT_PED_WEAPON.

Note, the client-side GET_SELECTED_PED_WEAPON native returns the weapon selected via the HUD (weapon wheel). This data is not available to FXServer.

Usage

Lua
local retval = GetSelectedPedWeapon(ped)

-- always works, by hash
local retval = Citizen.InvokeNative(0xd240123e, ped, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetSelectedPedWeapon(ped);

// by hash
const retval = Citizen.invokeNative('0xd240123e', ped, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xd240123e, ped);

Sources

Cfx.re native reference

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