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

Function

isTrainChainEngine

ServerVehiclesIdentical to MTA:SA

Checks whether a carriage is the locomotive leading the train.

Syntax

bool isTrainChainEngine(vehicle vehicle)

Arguments

vehiclevehicle
A train or carriage.

Returns

true for the leading locomotive.

Example

local train = createVehicle(538, 1700, -1950, 14)
outputDebugString(tostring(isTrainChainEngine(train)))

Notes

Always the default value. The server does not receive train consist information from the game yet, so the function returns false.

See also