RedM Natives

SET_CURRENT_PED_WEAPON_BY_GUID

Equips a weapon from a weaponItem, similar to GIVE_WEAPON_TO_PED

Hash0x12FB95FE3D579238
Runtime nameSetCurrentPedWeaponByGuid
NamespaceWEAPON
SideClient
NameOfficial
Docs
Since build1207

Signature

void SET_CURRENT_PED_WEAPON_BY_GUID(Ped ped, Any* weaponUid, BOOL p2, BOOL p3, BOOL p4, BOOL p5);

Parameters

NameTypeDescription
pedPed—
weaponUidAny*—
p2BOOL—
p3BOOL—
p4BOOL—
p5BOOL—

Returns void

Description

Equips a weapon from a weaponItem, similar to GIVE_WEAPON_TO_PED

Usage

Lua
local weaponUid = SetCurrentPedWeaponByGuid(ped, p2, p3, p4, p5)

-- always works, by hash
local weaponUid = Citizen.InvokeNative(0x12FB95FE3D579238, ped, Citizen.PointerValueInt(), p2, p3, p4, p5)
JavaScript and C#
JavaScript
const weaponUid = SetCurrentPedWeaponByGuid(ped, p2, p3, p4, p5);

// by hash
const weaponUid = Citizen.invokeNative('0x12FB95FE3D579238', ped, Citizen.pointerValueInt(), p2, p3, p4, p5);
C#
var weaponUid = new OutputArgument();
Function.Call((Hash)0x12FB95FE3D579238, ped, weaponUid, p2, p3, p4, p5);
// weaponUid.GetResult<int>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

Sources

alloc8or RDR3 NativeDB

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