CREATE_AMBIENT_PICKUP
Creates an ambient pickup of type pickupHash at the given coordinates and returns its object. Options cover the amount, a custom model and ownership.
Signature
Object CREATE_AMBIENT_PICKUP(Hash pickupHash, float x, float y, float z, int flags, int amount, Hash customModel, BOOL createAsScriptObject, BOOL scriptHostObject, int customAmmoType, float p10); // 0x673966A0C0FD7171 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | pickupHash | Hash |
| 2 | x | float |
| 3 | y | float |
| 4 | z | float |
| 5 | flags | int |
| 6 | amount | int |
| 7 | customModel | Hash |
| 8 | createAsScriptObject | BOOL |
| 9 | scriptHostObject | BOOL |
| 10 | customAmmoType | int |
| 11 | p10 | float |
Facts
| Name | CREATE_AMBIENT_PICKUP |
|---|---|
| Hash | 0x673966A0C0FD7171 |
| Namespace | |
| Returns | Object |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local objectOut = Citizen.InvokeNative(0x673966A0C0FD7171, -- CREATE_AMBIENT_PICKUP
GetHashKey("name"), -- Hash pickupHash
0.0, -- float x
0.0, -- float y
0.0, -- float z
0, -- int flags
0, -- int amount
GetHashKey("a_c_horse_arabian_white"), -- Hash customModel
false, -- BOOL createAsScriptObject
false, -- BOOL scriptHostObject
0, -- int customAmmoType
0.0, -- float p10
Citizen.ResultAsInteger()
)
print(objectOut)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const objectOut = Citizen.invokeNative("0x673966A0C0FD7171", // CREATE_AMBIENT_PICKUP
GetHashKey("name"), // Hash pickupHash
0.0, // float x
0.0, // float y
0.0, // float z
0, // int flags
0, // int amount
GetHashKey("a_c_horse_arabian_white"), // Hash customModel
false, // BOOL createAsScriptObject
false, // BOOL scriptHostObject
0, // int customAmmoType
0.0, // float p10
Citizen.resultAsInteger()
);
console.log(objectOut)int objectOut = Function.Call<int>((Hash)0x673966A0C0FD7171, // CREATE_AMBIENT_PICKUP
(uint)API.GetHashKey("name"), // Hash pickupHash
0.0f, // float x
0.0f, // float y
0.0f, // float z
0, // int flags
0, // int amount
(uint)API.GetHashKey("a_c_horse_arabian_white"), // Hash customModel
false, // BOOL createAsScriptObject
false, // BOOL scriptHostObject
0, // int customAmmoType
0.0f // float p10
);Related OBJECT natives
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.