GET_SELECTED_PED_WEAPON
An alias of GET_CURRENT_PED_WEAPON.
Signature
Hash GET_SELECTED_PED_WEAPON(Ped ped);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The target ped. |
Returns Hash — The weapon hash.
Description
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
local retval = GetSelectedPedWeapon(ped)
-- always works, by hash
local retval = Citizen.InvokeNative(0xd240123e, ped, Citizen.ResultAsInteger())JavaScript and C#
const retval = GetSelectedPedWeapon(ped);
// by hash
const retval = Citizen.invokeNative('0xd240123e', ped, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0xd240123e, ped);Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.