- Documentation
- Server functions
- isTrainChainEngine
Function
isTrainChainEngine
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.