getTrainCarriage
GET_TRAIN_CARRIAGE0x08AAFD0814722BC3The GTA V native GET_TRAIN_CARRIAGE of the VEHICLE namespace, as LS:MP client scripts call it: the global function getTrainCarriage, in JavaScript and in Lua.
getTrainCarriage(train: Vehicle, trailerNumber: number): VehiclegetTrainCarriage(train: Vehicle, trailerNumber: integer): VehicleUsage
JavaScript
const vehicle = getTrainCarriage(train, trailerNumber);Lua
local vehicle = getTrainCarriage(train, trailerNumber)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
train | Vehicle | number | integer |
trailerNumber | int | number | integer |
Returns
Vehicle JavaScript number, Lua integerGame handle of a vehicle. Not an LS:MP netId. Convert one with lsmp.getEntityFromNetId.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Corrected p1. it's basically the 'carriage/trailer number'. So if the train has 3 trailers you'd call the native once with a var or 3 times with 1, 2, 3.
Reference
- Namespace
- Vehicle VEHICLE
- In the game
Vehicle GET_TRAIN_CARRIAGE(Vehicle train, int trailerNumber)- Hash
0x08AAFD0814722BC3