setVehiclePanelState | Multi Theft Auto: Wiki Skip to content

setVehiclePanelState

Client-side
Server-side
Shared

Pair: getVehiclePanelState

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:setPanelState(...)

Syntax

bool setVehiclePanelState ( vehicle theVehicle, int panelID, int state, [ bool spawnFlyingComponent = true, bool breakGlass = false ] )
Required Arguments
  • theVehicle: MISSING_PARAM_DESC
  • panelID: MISSING_PARAM_DESC
  • state: MISSING_PARAM_DESC
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • spawnFlyingComponent (default: true): MISSING_PARAM_DESC
  • breakGlass (default: false): MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if the panel state has been updated, false otherwise

Code Examples

shared
-- create a new vehicle
local newcar = createVehicle ( 520, 1024, 1024, 1024 )
-- break the front bumper off
setVehiclePanelState ( newcar, 5, 3 )

See Also

Vehicle Functions