createMissionTrain
CREATE_MISSION_TRAIN0x63C6CCA8E68AE8C8The GTA V native CREATE_MISSION_TRAIN of the VEHICLE namespace, as LS:MP client scripts call it: the global function createMissionTrain, in JavaScript and in Lua.
createMissionTrain(
variation: number,
x: number,
y: number,
z: number,
direction: boolean,
networked: boolean,
scriptHost: boolean
): VehiclecreateMissionTrain(
variation: integer,
x: number,
y: number,
z: number,
direction: boolean,
networked: boolean,
scriptHost: boolean
): VehicleUsage
JavaScript
const vehicle = createMissionTrain(variation, x, y, z, direction, networked, scriptHost);Lua
local vehicle = createMissionTrain(variation, x, y, z, direction, networked, scriptHost)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
const vehicle = createMissionTrain(variation, pos, direction, networked, scriptHost);Lua · with vectors
local vehicle = createMissionTrain(variation, pos, direction, networked, scriptHost)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
variation | int | number | integer |
x | float | number | number |
y | float | number | number |
z | float | number | number |
direction | BOOL | boolean | boolean |
networked | BOOL | boolean | boolean |
scriptHost | BOOL | boolean | boolean |
Returns
Vehicle JavaScript number, Lua integerGame handle of a vehicle. Not an LS:MP netId. Convert one with lsmp.getEntityFromNetId.
On LS:MP
ℹ
Local mission train
Pass false for networked and scriptHost. Select an existing variation of up to 32 carriages, load every train model in that variation and place the origin near a loaded track. Returns the local locomotive handle, or 0 on failure.
ℹ
GTA V Enhanced 1158.16
This LS:MP adapter is available on Enhanced 1158.16. Calls on another build raise an error.
Reference
- Namespace
- Vehicle VEHICLE
- In the game
Vehicle CREATE_MISSION_TRAIN(int variation, float x, float y, float z, BOOL direction, BOOL networked, BOOL scriptHost)- Hash
0x63C6CCA8E68AE8C8