ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setTrainPosition

Function

setTrainPosition

ServerVehiclesIdentical to MTA:SA

Stores a train's position on the track as the distance from the start of the track.

Syntax

bool setTrainPosition(vehicle train, float position)

Arguments

trainvehicle
The train.
positionfloat
Distance from the start of the track in metres.

Returns

true on success.

Example

local train = createVehicle(538, 1700, -1950, 14)
setTrainPosition(train, 1200)

Notes

State for scripts. See setTrainDerailed.

See also