SetTrainTrack: Difference between revisions
Jump to navigation
Jump to search
m (fix typo) |
m (missing player element in outputchatbox) |
||
Line 22: | Line 22: | ||
local theVehicle = getPedOccupiedVehicle(player) | local theVehicle = getPedOccupiedVehicle(player) | ||
if not theVehicle then | if not theVehicle then | ||
outputChatBox("You are not in a vehicle!") | outputChatBox("You are not in a vehicle!", player) | ||
return | return | ||
end | end | ||
Line 29: | Line 29: | ||
setTrainTrack(theVehicle, track) | setTrainTrack(theVehicle, track) | ||
else | else | ||
outputChatBox("You are not in a train!") | outputChatBox("You are not in a train!", player) | ||
end | end | ||
end | end | ||
Line 39: | Line 39: | ||
local veh = player.vehicle | local veh = player.vehicle | ||
if not veh then | if not veh then | ||
return outputChatBox("You are not in a vehicle!") | return outputChatBox("You are not in a vehicle!", player) | ||
end | end | ||
Line 45: | Line 45: | ||
veh.track = track | veh.track = track | ||
else | else | ||
outputChatBox("You are not in a train!") | outputChatBox("You are not in a train!", player) | ||
end | end | ||
end | end |
Revision as of 15:28, 20 February 2018
Sets the track of a train
Syntax
bool setTrainTrack ( vehicle train, int track )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setTrack(...)
- Variable: .track
- Counterpart: getTrainTrack
Required Arguments
- train: the train of which to set the track
- track: the track where you want to set the train. It can be 0, 1, 2 or 3.
Returns
Returns true if the track was set to the train, false otherwise.
Example
This server-side script allows the player to change the track of their train.
Click to expand [+]
ProceduralClick to expand [+]
Object OrientedSee Also
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- 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
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates