FixVehicle: Difference between revisions
Jump to navigation
Jump to search
m (No such function) |
(OOP) |
||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Server client function}} | {{Server client function}} | ||
This function will set a [[vehicle]]'s health to full and fix its damage model. If you wish to only change the vehicle's health, without affecting its damage model, use [[setElementHealth]]. | This function will set a [[vehicle]]'s health to full and fix its damage model. If you wish to only change the vehicle's health, without affecting its damage model, use [[setElementHealth]]. | ||
Line 7: | Line 7: | ||
bool fixVehicle ( vehicle theVehicle ) | bool fixVehicle ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:fix}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' | *'''theVehicle:''' the vehicle you wish to fix | ||
===Returns=== | ===Returns=== |
Revision as of 15:50, 13 October 2014
This function will set a vehicle's health to full and fix its damage model. If you wish to only change the vehicle's health, without affecting its damage model, use setElementHealth.
Syntax
bool fixVehicle ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:fix(...)
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 ipairs(vehicles) do -- fix the vehicle fixVehicle ( vehicleValue ) 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