SetVehicleWheelStates: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 23: Line 23:
==Example==
==Example==
This example creates a new vehicle then punctures its front left wheel.
This example creates a new vehicle then punctures its front left wheel.
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 )
<syntaxhighlight lang="lua">local newcar = createVehicle ( 422, 1024, 1024, 1024 ) --Creates a Bobcat
state = setVehicleWheelStates ( newcar, 1 ) -- Punctures the front-left wheel on the vehicle
state = setVehicleWheelStates ( newcar, 1 ) --Punctures the front-left wheel on the vehicle
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}

Revision as of 14:58, 1 August 2007

This function sets the state of wheels on the vehicle.

Internally, no vehicles have more than 4 wheels. If they appear to, they will be duplicating other wheels.

Syntax

setVehicleWheelStates ( vehicle theVehicle, int frontLeft, [ int rearLeft = -1, int frontRight = -1, int rearRight = -1 ])

Required Arguments

  • theVehicle: A handle to the vehicle that you wish to change the wheel states of.
  • frontLeft: A whole number representing the wheel state (-1 for no change)

Optional Arguments

  • rearLeft: A whole number representing the wheel state (-1 for no change)
  • frontRight: A whole number representing the wheel state (-1 for no change)
  • rearRight: A whole number representing the wheel state (-1 for no change)

Wheel-State values

  • 0: Inflated
  • 1: Flat
  • 2: Fallen off

Example

This example creates a new vehicle then punctures its front left wheel.

local newcar = createVehicle ( 422, 1024, 1024, 1024 ) --Creates a Bobcat
state = setVehicleWheelStates ( newcar, 1 ) --Punctures the front-left wheel on the vehicle

See Also