SetVehiclePanelState: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Added OOP syntax.) |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setVehiclePanelState ( vehicle theVehicle, int panelID, int state )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setVehiclePanelState ( vehicle theVehicle, int panelID, int state )</syntaxhighlight> | ||
{{OOP||[[vehicle]]:setPanelState||getVehiclePanelState}} | |||
==Required Arguments== | ==Required Arguments== | ||
*'''theVehicle:''' The [[vehicle]] you would like to modify the panel of. | *'''theVehicle:''' The [[vehicle]] you would like to modify the panel of. | ||
*'''panelID:''' 0- | *'''panelID:''' An ID specifying the part of the vehicle. Possible values are: | ||
**''' | |||
**'''5:''' Front | *'''Cars:''' | ||
**''' | ** '''0:''' Front-left panel | ||
**'''3:''' | ** '''1:''' Front-right panel | ||
**''' | ** '''2:''' Rear-left panel | ||
**''' | ** '''3:''' Rear-right panel | ||
**''' | ** '''4:''' Windscreen | ||
*'''state:''' 0 | ** '''5:''' Front bumper | ||
** '''6:''' Rear bumper | |||
*'''Planes:''' | |||
**'''0:''' Engine Smoke (left engine for a Nevada or a Beagle) | |||
**'''1:''' Engine Smoke (right engine for a Nevada or a Beagle) | |||
**'''2:''' Rudder | |||
**'''3:''' Elevators | |||
**'''4:''' Ailerons | |||
**'''5:''' Unknown | |||
**'''6:''' Unknown | |||
''NOTE:'' Settings are not applicable for all vehicles of these types, for instance panel 0 effects a Dodo, but does nothing to a hydra. | |||
*'''state:''' How damaged the part is on the scale of 0 to 3, with 0 being undamaged and 3 being very damaged. How this is manifested depends on the panel and the vehicle. | |||
==Returns== | ==Returns== | ||
Returns ''true'' if the panel state has been updated, ''false'' otherwise | Returns ''true'' if the panel state has been updated, ''false'' otherwise | ||
==Example== | |||
<section name="Example 1: Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
-- create a new vehicle | |||
local newcar = createVehicle ( 520, 1024, 1024, 1024 ) | |||
-- break the front bumper off | |||
setVehiclePanelState ( newcar, 5, 3 ) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} |
Latest revision as of 22:29, 6 April 2018
This function allows you to change the state of one of the six panels vehicle's can have. When executed on the server-side resources, the damage will be synched for all players, whereas the change is only client-side if the function is used in a client resource.
Syntax
bool setVehiclePanelState ( vehicle theVehicle, int panelID, int state )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setPanelState(...)
- Counterpart: getVehiclePanelState
Required Arguments
- theVehicle: The vehicle you would like to modify the panel of.
- panelID: An ID specifying the part of the vehicle. Possible values are:
- Cars:
- 0: Front-left panel
- 1: Front-right panel
- 2: Rear-left panel
- 3: Rear-right panel
- 4: Windscreen
- 5: Front bumper
- 6: Rear bumper
- Planes:
- 0: Engine Smoke (left engine for a Nevada or a Beagle)
- 1: Engine Smoke (right engine for a Nevada or a Beagle)
- 2: Rudder
- 3: Elevators
- 4: Ailerons
- 5: Unknown
- 6: Unknown
NOTE: Settings are not applicable for all vehicles of these types, for instance panel 0 effects a Dodo, but does nothing to a hydra.
- state: How damaged the part is on the scale of 0 to 3, with 0 being undamaged and 3 being very damaged. How this is manifested depends on the panel and the vehicle.
Returns
Returns true if the panel state has been updated, false otherwise
Example
Click to collapse [-]
Example 1: Server-- create a new vehicle local newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- break the front bumper off setVehiclePanelState ( newcar, 5, 3 )
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