The Lab
WEAPON native

_CREATE_WEAPON_OBJECT

returns Object7 paramsbuild 1207

Creates a world object for the weapon weaponHash with the given ammo, position and scale, and returns its handle.

Load the weapon asset first with _REQUEST_WEAPON_ASSET.

Signature

C
Object _CREATE_WEAPON_OBJECT(Hash weaponHash, int ammoCount, float x, float y, float z, BOOL showWorldModel, float scale); // 0x9888652B8BA77F73 b1207

Parameters

#NameType
1weaponHashHash
2ammoCountint
3xfloat
4yfloat
5zfloat
6showWorldModelBOOL
7scalefloat

Facts

Facts about _CREATE_WEAPON_OBJECT
Name
_CREATE_WEAPON_OBJECT
Hash
0x9888652B8BA77F73
Namespace
Returns
Object
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local objectOut = Citizen.InvokeNative(0x9888652B8BA77F73, -- _CREATE_WEAPON_OBJECT
  GetHashKey("weapon_revolver_cattleman"), -- Hash weaponHash
  0, -- int ammoCount
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  false, -- BOOL showWorldModel
  0.0, -- float scale
  Citizen.ResultAsInteger()
)
print(objectOut)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const objectOut = Citizen.invokeNative("0x9888652B8BA77F73", // _CREATE_WEAPON_OBJECT
  GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
  0, // int ammoCount
  0.0, // float x
  0.0, // float y
  0.0, // float z
  false, // BOOL showWorldModel
  0.0, // float scale
  Citizen.resultAsInteger()
);
console.log(objectOut)
C#
int objectOut = Function.Call<int>((Hash)0x9888652B8BA77F73, // _CREATE_WEAPON_OBJECT
  (uint)API.GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
  0, // int ammoCount
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  false, // BOOL showWorldModel
  0.0f // float scale
);
All WEAPON natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.