RedM Natives

_CREATE_HERB_COMPOSITES

Returns compositeId

Hash0x5B4BBE80AD5972DC
Runtime nameCreateHerbComposites
NamespaceTASK
SideClient
NameCommunity guess
Docs
Since build1207

Signature

int _CREATE_HERB_COMPOSITES(Hash asset, float x, float y, float z, float heading, int groundSetting, Any* p6, int p7);

Parameters

NameTypeDescription
assetHash—
xfloat—
yfloat—
zfloat—
headingfloat—
groundSettingint—
p6Any*—
p7int—

Returns int

Description

groundSetting: 0: spawn on ground, 2 (1?): do not spawn on ground
p7: -1 in R* Scripts
Returns compositeId

Usage

Lua
local retval, p6 = CreateHerbComposites(asset, x, y, z, heading, groundSetting, p7)

-- always works, by hash
local retval, p6 = Citizen.InvokeNative(0x5B4BBE80AD5972DC, asset, x, y, z, heading, groundSetting, Citizen.PointerValueInt(), p7, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, p6] = CreateHerbComposites(asset, x, y, z, heading, groundSetting, p7);

// by hash
const [retval, p6] = Citizen.invokeNative('0x5B4BBE80AD5972DC', asset, x + 0.0000001, y + 0.0000001, z + 0.0000001, heading + 0.0000001, groundSetting, Citizen.pointerValueInt(), p7, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var p6 = new OutputArgument();
int retval = Function.Call<int>((Hash)0x5B4BBE80AD5972DC, asset, x, y, z, heading, groundSetting, p6, p7);
// p6.GetResult<int>()
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.
  • 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.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB

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