GetVehicleHandling: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
This function can get a vehicle's handling.<br> | This function can get a vehicle's handling.<br> | ||
''*'''Note:''' This function is still not implemented | ''*'''Note:''' This function is still not implemented in the nightly, and is currently only implemented in the handling branch!'' | ||
==Syntax== | ==Syntax== | ||
Line 19: | Line 19: | ||
This example simplifies the use of getVehicleHandling | This example simplifies the use of getVehicleHandling | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
_getVehicleHandling = getVehicleHandling() | _getVehicleHandling = getVehicleHandling() -- replace the original getVehicleHandling function as _getVehicleHandling | ||
function getVehicleHandling( | function getVehicleHandling(ele, prop) | ||
if | if ele and prop then -- there is an element and property | ||
if getElementType( | if getElementType(ele) == "vehicle" then -- if the type of the element is a vehicle | ||
local handlingTable = _getVehicleHandling( | local handlingTable = _getVehicleHandling(ele) -- get the handling as table and save as handlingTable | ||
local value = handlingTable.prop | local value = handlingTable.prop -- make the value wanted | ||
return value | return value -- return the value wanted! | ||
end | end | ||
end | end |
Revision as of 19:44, 6 May 2011
This function can get a vehicle's handling.
*Note: This function is still not implemented in the nightly, and is currently only implemented in the handling branch!
Syntax
table getVehicleHandling(element theVehicle)
Required Arguments
- theVehicle: The vehicle you wish to get the handling of
Returns
Returns a table, false otherwise.
Example
This example simplifies the use of getVehicleHandling
_getVehicleHandling = getVehicleHandling() -- replace the original getVehicleHandling function as _getVehicleHandling function getVehicleHandling(ele, prop) if ele and prop then -- there is an element and property if getElementType(ele) == "vehicle" then -- if the type of the element is a vehicle local handlingTable = _getVehicleHandling(ele) -- get the handling as table and save as handlingTable local value = handlingTable.prop -- make the value wanted return value -- return the value wanted! end end end
See other vehicle functions
- 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