SetVehiclePanelState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 9: Line 9:
==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-6
*'''panelID:''' An ID specifying the part of the vehicle. Possible values are:


*'''Cars (0-3):'''
*'''Cars:'''
**'''6:''' Rear Bumper
** '''0:''' Front-left panel
**'''5:''' Front Bumper
** '''1:''' Front-right panel
**'''4:''' Windscreen
** '''2:''' Rear-left panel
**'''3:''' Unknown
** '''3:''' Rear-right panel
**'''2:''' Unknown
** '''4:''' Windscreen
** '''5:''' Front bumper
** '''6:''' Rear bumper
 
*'''Planes:'''
**'''0:''' Engine Smoke
**'''1:''' Unknown
**'''1:''' Unknown
**'''0:''' Unknown
**'''2:''' Rudder
 
**'''3:''' Elevators
*'''Planes (0-3):'''
**'''4:''' Ailerons
**'''5:''' Unknown
**'''6:''' Unknown
**'''6:''' Unknown
**'''5:''' Unknown
**'''4:''' Ailerons
**'''3:''' Elevators
**'''2:''' Rudder
**'''1:''' Unknown
**'''0:''' Engine Smoke


''NOTE:'' Settings are not applicable for all vehicles of these types, for instance panel 0 effects a Dodo, but does nothing to a hydra.
''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:''' 0-3 (seems ineffective out of this range, check though)
*'''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==

Revision as of 00:56, 24 September 2008

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 )

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
    • 1: Unknown
    • 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