SetTrainDerailable
From Multi Theft Auto: Wiki
This function will set a train or tram as derailable. This is, if it can derail when it goes above the maximum speed.
Syntax
bool setTrainDerailable ( vehicle derailableVehicle, bool derailable )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setDerailable(...)
- Variable: .derailable
- Counterpart: isTrainDerailable
Required Arguments
- derailableVehicle: The vehicle that you wish to set derailable.
- derailable: whether the train or tram is derailable. True as derailable, False as non-derailable.
Returns
Returns true if the state was successfully set, false otherwise.
Example
Click to collapse [-]
ExampleThis example will make a train east of LS station which can not be derailed, and start moving it.
function makeTrain(source) local myTrain = createVehicle(537,1995,-1949,13) -- This will make a freight train just east of the LS train station setTrainDerailable(myTrain, false) -- myTrain can not be derailed now outputChatBox("A freight train has been created for you.", source, 255, 255, 0) -- Just a simple message for the player warpPedIntoVehicle(source, myTrain) -- This will warp you to inside the train setTrainSpeed(myTrain, 1) -- Set the train speed to 1 - 100mph, 160kmh end addCommandHandler("trainmeup", makeTrain)
See Also
FROM VERSION 1.5.7 r19626 ONWARDS
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- 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
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- getVehiclesOfType
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition