GetTrainTrack: Difference between revisions
Jump to navigation
Jump to search
m (make something clearer) |
m (replace delete with disabled) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Shared function}} | ||
{{Disabled}} | |||
{{New feature/item|3.0160|1.6|7485| | {{New feature/item|3.0160|1.6|7485| | ||
Gets the track of a train | Gets the track of a train | ||
Line 17: | Line 18: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler(" | addCommandHandler("traintrack", | ||
function () | function (player) | ||
if isPedInVehicle (player) then | |||
local theVehicle = getPedOccupiedVehicle(player) | |||
if getVehicleType(theVehicle) == "Train" then | |||
local track = getTrainTrack(theVehicle) | |||
end) | outputChatBox("Train Track is "..track,player,0,255,0) | ||
end | |||
end | |||
end | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} |
Latest revision as of 19:36, 19 May 2019
Function has been disabled. | |
Gets the track of a train
Syntax
int getTrainTrack ( vehicle train )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getTrack(...)
- Variable: .track
- Counterpart: setTrainTrack
Required Arguments
- train: the train of which to get the track.
Returns
Returns an integer (whole number) that represents the train track, false if there is problem with train element.
Example
addCommandHandler("traintrack", function (player) if isPedInVehicle (player) then local theVehicle = getPedOccupiedVehicle(player) if getVehicleType(theVehicle) == "Train" then local track = getTrainTrack(theVehicle) outputChatBox("Train Track is "..track,player,0,255,0) end end end )
See 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