SetVehiclePanelState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 22: Line 22:
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="Server and Client" class="both" show="true">
<syntaxhighlight lang="lua">
-- create a new vehicle
local newcar = createVehicle ( 520, 1024, 1024, 1024 )
-- break the front bumper off
setVehiclePanelState ( newcar, 5, 4 )
</syntaxhighlight>
</section>
==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}

Revision as of 22:27, 25 January 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: 0-6
    • 6: Rear Bumper (0-3)
    • 5: Front Bumper (0-3)
    • 4: Windscreen (0-3)
    • 3: Unknown
    • 2: Unknown
    • 1: Unknown
    • 0: Unknown
  • state: 0-255 (check what range is effective, it may be much smaller e.g. 0-3)

Returns

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

Example

Click to collapse [-]
Server and Client
-- create a new vehicle
local newcar = createVehicle ( 520, 1024, 1024, 1024 )
-- break the front bumper off
setVehiclePanelState ( newcar, 5, 4 )

See Also