SetTrainDirection
Jump to navigation
Jump to search
Sets the direction in which a train or tram drives over the rails (clockwise or counterclockwise).
Syntax
bool setTrainDirection ( vehicle train, bool clockwise )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setDirection(...)
- Variable: .direction
- Counterpart: getTrainDirection
Required Arguments
- train: the train whose direction to change.
- clockwise: if true, will make the train go clockwise. If false, makes it go counterclockwise.
Returns
Returns true if successful, false otherwise.
Example
This function will make a train driving clockwise.
function createTrain(source) local myTrain = createVehicle(537,1995,-1949,13) -- Create the train setTrainDirection(myTrain, true) -- Make the train drive clockwise setTrainSpeed(myTrain, 1) -- Speed up end addCommandHandler("mytrain", createTrain)
See Also
- addVehicleSirens
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehiclesOfType
- getVehicleTowedByVehicle
- getVehicleTowingVehicle