{"hash":"0x119A5714578F4E05","ns":"ENTITY","name":"_FORCE_TRAIN_WAGON_POPULATION","slug":"_FORCE_TRAIN_WAGON_POPULATION","official":false,"named":true,"luaName":"ForceTrainWagonPopulation","game":"rdr3","apiset":"client","returnType":"void","params":[{"name":"trainWagon","type":"Entity"},{"name":"toggle","type":"BOOL"}],"summary":"Enable/disable automatic ambient passenger population on a train wagon (carriage).","descriptions":[{"source":"alloc8or","format":"text","body":"Enable/disable automatic ambient passenger population on a train wagon (carriage).\n\t- toggle=true: wagon is kept populated; removed/deleted passengers are replaced quickly.\n\t- toggle=false: stop auto-filling; after removing passengers, no new peds spawn until re-enabled.\n\nNotes:\n\t- Intended for train carriage entities (wagons) obtained from a train (e.g., VEHICLE::GET_TRAIN_CARRIAGE).\n\t- Often used with passenger collection via VEHICLE::_GET_ALL_WAGON_PASSENGERS.\n\nExample (from scripts):\n\tfor (int i = 0; i < VEHICLE::_GET_NUM_CARS_FROM_TRAIN_CONFIG(trainConfig); ++i) {\n\t\tVehicle wagon = VEHICLE::GET_TRAIN_CARRIAGE(train, i);\n\t\tif (ENTITY::DOES_ENTITY_EXIST(wagon) && !ENTITY::IS_ENTITY_DEAD(wagon)) {\n\t\t\tENTITY::_FORCE_TRAIN_WAGON_POPULATION(wagon, true);\n\t\t}\n\t}"},{"source":"vorp","format":"text","body":"Enables or disables automatic passenger population on a specific train wagon (carriage).\n\nWhen toggle == true, the game keeps this wagon filled with ambient passengers.\nIf a passenger ped is deleted or removed from the wagon, a new ped is spawned almost\nimmediately to occupy that seat.\n\nWhen toggle == false, the engine stops auto-filling this wagon. After you delete or\nremove the existing passengers, no new peds will spawn for that wagon until you enable\nit again with true."}],"examples":[],"aliases":[],"enums":[],"related":[],"build":"1207","sources":["alloc8or","vorp"],"doc":2,"url":"https://natives.borderlinerp.com/natives/ENTITY/_FORCE_TRAIN_WAGON_POPULATION","markdownUrl":"https://natives.borderlinerp.com/natives/ENTITY/_FORCE_TRAIN_WAGON_POPULATION.md","snippets":{"lua":"ForceTrainWagonPopulation(trainWagon, toggle)","luaInvoke":"Citizen.InvokeNative(0x119A5714578F4E05, trainWagon, toggle)","js":"ForceTrainWagonPopulation(trainWagon, toggle);","jsInvoke":"Citizen.invokeNative('0x119A5714578F4E05', trainWagon, toggle);","csharp":"Function.Call((Hash)0x119A5714578F4E05, trainWagon, toggle);","notes":["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."]}}