FixVehicle: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This | This function will set a [[vehicle]]'s health to full and fix it's damage model. If you wish to just change the vehicle's health, without affecting it's damage model, use [[setVehicleHealth]]. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool fixVehicle ( | bool fixVehicle ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theVehicle:''' The vehicle you wish to fix | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if the vehicle was fixed, ''false'' if ''theVehicle'' is invalid. | ||
==Example== | ==Example== | ||
This example | This example fixes all the vehicles that exist in the map. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | -- Retrieve a table containing all the vehicles that exist | ||
vehicles = getElementsByType ( "vehicle" ) | |||
-- | -- Loop through the list, storing the vehicle from the table in the variable vehicleValue | ||
for vehicleKey, vehicleValue in blips do | |||
-- fix the vehicle | |||
fixVehicle( vehicleHealth ) | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Vehicle_functions}} |
Revision as of 12:10, 25 May 2006
This function will set a vehicle's health to full and fix it's damage model. If you wish to just change the vehicle's health, without affecting it's damage model, use setVehicleHealth.
Syntax
bool fixVehicle ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle you wish to fix
Returns
Returns true if the vehicle was fixed, false if theVehicle is invalid.
Example
This example fixes all the vehicles that exist in the map.
-- Retrieve a table containing all the vehicles that exist vehicles = getElementsByType ( "vehicle" ) -- Loop through the list, storing the vehicle from the table in the variable vehicleValue for vehicleKey, vehicleValue in blips do -- fix the vehicle fixVehicle( vehicleHealth ) 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