GetVehicleTowedByVehicle: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Server client function}} | |||
__NOTOC__ | __NOTOC__ | ||
This function is used to get the vehicle being towed by another. | This function is used to get the vehicle being towed by another. | ||
Line 14: | Line 15: | ||
This example will create a trailer and a trailer-tower, attach them, then check if they attached. | This example will create a trailer and a trailer-tower, attach them, then check if they attached. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
towingVehicle = createVehicle ( 515, 500, 500, 40 ) -- create a trailer-tower (roadtrain) | |||
trailer = createVehicle ( 435, 500, 505, 40 ) -- create a trailer | trailer = createVehicle ( 435, 500, 505, 40 ) -- create a trailer | ||
attachTrailerToVehicle ( | attachTrailerToVehicle ( towingVehicle, trailer ) -- attach them | ||
if ( getVehicleTowedByVehicle ( | if ( getVehicleTowedByVehicle ( towingVehicle ) == trailer ) then -- if it attached | ||
outputChatBox ( " | outputChatBox ( "The vehicles were attached!" ) | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 17:02, 17 August 2007
This function is used to get the vehicle being towed by another.
Syntax
vehicle getVehicleTowedByVehicle ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle you wish to get the towed vehicle from.
Returns
Returns the vehicle that 'theVehicle' is towing, 'nil' if it isn't towing a vehicle.
Example
This example will create a trailer and a trailer-tower, attach them, then check if they attached.
towingVehicle = createVehicle ( 515, 500, 500, 40 ) -- create a trailer-tower (roadtrain) trailer = createVehicle ( 435, 500, 505, 40 ) -- create a trailer attachTrailerToVehicle ( towingVehicle, trailer ) -- attach them if ( getVehicleTowedByVehicle ( towingVehicle ) == trailer ) then -- if it attached outputChatBox ( "The vehicles were attached!" ) 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