SpawnVehicleFlyingComponent: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Shared function}} {{New feature/item|3.0161|1.6.0|22771| This function creates a dynamic (motion-dependent) falling vehicle component.}} {{Note|The maximum number of components that can be created simultaneously is 150. Beyond this limit, no new components will be created until an existing component is removed and the count drops below 150.}} ==Syntax== <syntaxhighlight lang="lua"> bool spawnVehicleFlyingComponent(vehicle theVehicle, number nodeIndex [, num...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
===Required Arguments===
===Required Arguments===
*'''theVehicle:''' The vehicle whose component is to be created.
*'''theVehicle:''' The vehicle whose component is to be created.
*'''nodeIndex:''' Specifies the component to be created (ranging from '''1''' to '''25'''). Depending on the vehicle, these can be different components such as wheels, fenders, bicycle handlebars, helicopter propellers, train carriages, and many more. You can find the vehicle components here [[Vehicle Components]].
*'''nodeIndex:''' Specifies the component to be created (ranging from '''1''' to '''24'''). Depending on the vehicle, these can be different components such as wheels, fenders, bicycle handlebars, helicopter propellers, train carriages, and many more. Check [[Vehicle Components#Component nodes|Nodes list]].
 
===Optional Arguments===
{{OptionalArg}}
*'''collisionType:''' Specifies the type of collision for the component, by default it is selected based on the nodeIndex.
*'''collisionType:''' Specifies the type of collision for the component, by default it is selected based on the nodeIndex.
**'''0:''' COL_BUMPER
**'''0:''' COL_BUMPER

Latest revision as of 22:12, 12 October 2024

ADDED/UPDATED IN VERSION 1.6.0 r22771:
This function creates a dynamic (motion-dependent) falling vehicle component.
[[{{{image}}}|link=|]] Note: The maximum number of components that can be created simultaneously is 150. Beyond this limit, no new components will be created until an existing component is removed and the count drops below 150.

Syntax

bool spawnVehicleFlyingComponent(vehicle theVehicle, number nodeIndex [, number collisionType, number removalTime ] )

OOP Syntax Help! I don't understand this!

Method: element:spawnFlyingComponent(...)


Required Arguments

  • theVehicle: The vehicle whose component is to be created.
  • nodeIndex: Specifies the component to be created (ranging from 1 to 24). Depending on the vehicle, these can be different components such as wheels, fenders, bicycle handlebars, helicopter propellers, train carriages, and many more. Check Nodes list.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • collisionType: Specifies the type of collision for the component, by default it is selected based on the nodeIndex.
    • 0: COL_BUMPER
    • 1: COL_WHEEL
    • 2: COL_DOOR
    • 3: COL_BONNET
    • 4: COL_BOOT
    • 5: COL_PANEL
  • removalTime: The time in milliseconds after which the created component will be removed (it must be removed as it is a temporary object). If not specified, the default time depends on the number of created components.

Returns

Returns true if the component was created, false otherwise.

Example

Accessories-text-editor.png Script Example Missing Function SpawnVehicleFlyingComponent needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.


See Also