_GET_ALL_WAGON_PASSENGERS
Collects all passenger peds (excluding the driver) from the specified wagon-type vehicle (train wagon) and appends them to itemSet as indexed items.
0x0E558D3A49D759D6GetAllWagonPassengers_GET_ALL_TRAIN_WAGON_PASSENGERSSignature
int _GET_ALL_WAGON_PASSENGERS(Vehicle wagon, ItemSet itemSet);Parameters
| Name | Type | Description |
|---|---|---|
wagon | Vehicle | — |
itemSet | ItemSet | — |
Returns int
Description
Collects all passenger peds (excluding the driver) from the specified wagon-type vehicle (train wagon) and appends them to itemSet as indexed items. Returns the number of passengers added (0 if none / invalid / non-wagon).
Notes:
- Only works on wagon entities (train wagons). Regular vehicles/coaches typically return 0.
- Clear the itemset before calling.
- If you also need the driver, query GET_DRIVER_OF_VEHICLE(wagon) and handle/add it separately (see scripts).
- Resolve returned entries via indexed item helpers:
Ped p = MISC::_GET_PED_FROM_INDEXED_ITEM(ITEMSET::GET_INDEXED_ITEM_IN_ITEMSET(i, itemSet));
(or: Entity e = MISC::_GET_ENTITY_FROM_ITEM(...); then ENTITY::GET_PED_INDEX_FROM_ENTITY_INDEX(e)).
- Wagon auto-population can be toggled via ENTITY::_0x119A5714578F4E05(wagon, bool); scripts disable it in some flows.Example image: https://imgur.com/a/2V8Uk2K
Example (C++):
ItemSet set = ITEMSET::CREATE_ITEMSET(true);
ITEMSET::_CLEAR_ITEMSET(set);
int count = VEHICLE::_GET_ALL_WAGON_PASSENGERS(wagon, set);
for (int i = 0; i < count; ++i) {
Ped p = MISC::_GET_PED_FROM_INDEXED_ITEM(ITEMSET::GET_INDEXED_ITEM_IN_ITEMSET(i, set));
if (ENTITY::DOES_ENTITY_EXIST(p) && !ENTITY::IS_ENTITY_DEAD(p)) {
// ...
}
}
ITEMSET::DESTROY_ITEMSET(set);Collects all passenger peds (excluding the driver) from the specified wagon-type vehicle and adds them as indexed items to the provided itemset.
Notes:
- Always clear the itemset before calling.
- Returns 0 if the wagon is empty or auto-population is disabled
(ENTITY::_0x119A5714578F4E05(wagon, false)).
- Itemset may contain dead peds; filter with IS_ENTITY_DEAD if needed.
- Often used alongside wagon auto-population management.
Usage
local retval = GetAllWagonPassengers(wagon, itemSet)
-- always works, by hash
local retval = Citizen.InvokeNative(0x0E558D3A49D759D6, wagon, itemSet, Citizen.ResultAsInteger())JavaScript and C#
const retval = GetAllWagonPassengers(wagon, itemSet);
// by hash
const retval = Citizen.invokeNative('0x0E558D3A49D759D6', wagon, itemSet, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0x0E558D3A49D759D6, wagon, itemSet);- The name is a community guess and may change. If the named call is missing in your client build, use
InvokeNativewith the hash — it always works.
Sources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.