SET_CURRENT_PED_WEAPON_BY_GUID
Equips a weapon from a weaponItem, similar to GIVE_WEAPON_TO_PED
Hash
0x12FB95FE3D579238Runtime name
SetCurrentPedWeaponByGuidNamespaceWEAPON
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
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
weaponUid | Any* | — |
p2 | BOOL | — |
p3 | BOOL | — |
p4 | BOOL | — |
p5 | BOOL | — |
Returns void
Description
Equips a weapon from a weaponItem, similar to GIVE_WEAPON_TO_PED
Usage
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#
const weaponUid = SetCurrentPedWeaponByGuid(ped, p2, p3, p4, p5);
// by hash
const weaponUid = Citizen.invokeNative('0x12FB95FE3D579238', ped, Citizen.pointerValueInt(), p2, p3, p4, p5);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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.