SetTrainDerailable: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
No edit summary  | 
				|||
| Line 19: | Line 19: | ||
This example will make a train east of LS station which can not be derailed.  | This example will make a train east of LS station which can not be derailed.  | ||
<syntaxhighlight lang="lua">  | <syntaxhighlight lang="lua">  | ||
function makeTrain(  | function makeTrain(source)  | ||
	local myTrain = createVehicle(537,1995,-1949,13)  -- This will make a freight train just east of the LS train station  | 	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  | 	setTrainDerailable(myTrain, false) -- myTrain can not be derailed now  | ||
	outputChatBox("A freight train has been created for you.",   | 	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  | |||
end  | end  | ||
addCommandHandler("trainmeup", makeTrain)  | addCommandHandler("trainmeup", makeTrain)  | ||
Revision as of 09:39, 4 May 2010
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 )
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.
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
end
addCommandHandler("trainmeup", makeTrain)
See Also
- addVehicleUpgrade
 - addVehicleSirens
 - attachTrailerToVehicle
 - blowVehicle
 - createVehicle
 - detachTrailerFromVehicle
 - fixVehicle
 - getOriginalHandling
 - getTrainDirection
 - getTrainPosition
 - getTrainSpeed
 - getVehicleColor
 - getVehicleCompatibleUpgrades
 - getVehicleController
 - getVehicleDoorOpenRatio
 - getVehicleDoorState
 - getVehicleEngineState
 - getVehicleHandling
 - getVehicleHeadLightColor
 - getVehicleLandingGearDown
 - getVehicleLightState
 - getVehicleMaxPassengers
 - getVehicleModelFromName
 - getVehicleName
 - getVehicleNameFromModel
 - setVehicleNitroActivated
 - getVehicleOccupant
 - getVehicleOccupants
 - getVehicleOverrideLights
 - getVehiclePaintjob
 - getVehiclePanelState
 - getVehiclePlateText
 - getVehicleSirenParams
 - getVehicleSirens
 - getVehicleSirensOn
 - getVehicleTowedByVehicle
 - getVehicleTowingVehicle
 - getVehicleTurretPosition
 - getVehicleType
 - getVehicleUpgradeOnSlot
 - getVehicleUpgradeSlotName
 - getVehicleUpgrades
 - getVehicleVariant
 - getVehicleWheelStates
 - isTrainDerailable
 - isTrainDerailed
 - isVehicleBlown
 - isVehicleDamageProof
 - isVehicleFuelTankExplodable
 - isVehicleLocked
 - isVehicleOnGround
 - isVehicleTaxiLightOn
 - removeVehicleUpgrade
 - removeVehicleSirens
 - setTrainDerailable
 - setTrainDerailed
 - setTrainDirection
 - setTrainPosition
 - setTrainSpeed
 - setVehicleColor
 - setVehicleDamageProof
 - setVehicleDoorOpenRatio
 - setVehicleDoorState
 - setVehicleDoorsUndamageable
 - setVehicleEngineState
 - setVehicleFuelTankExplodable
 - setVehicleHandling
 - setVehicleHeadLightColor
 - setVehicleLandingGearDown
 - setVehicleLightState
 - setVehicleLocked
 - setVehicleOverrideLights
 - setVehiclePaintjob
 - setVehiclePanelState
 - setVehiclePlateText
 - setVehicleSirens
 - setVehicleSirensOn
 - setVehicleTaxiLightOn
 - setVehicleTurretPosition
 - setVehicleVariant
 - setVehicleWheelStates