SetElementAngularVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
(Remove spaces)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{New feature/item|3.0156|1.5.5|14060|Sets the angular velocity of a specified, supported element (Applies a spin to it).}}
{{New feature/item|3.0156|1.5.5|14165|Sets the angular velocity of a specified, supported element (Applies a spin to it).}}


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setElementAngularVelocity ( element theElement, float rx, float ry, float rz )          
bool setElementAngularVelocity ( element theElement, float rx, float ry, float rz )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[element]]:setAngularVelocity|angularVelocity|getElementAngularVelocity}}
{{OOP||[[element]]:setAngularVelocity|angularVelocity|getElementAngularVelocity}}
===Required Arguments===  
===Required Arguments===  
*'''theElement:''' The [[element]] to apply the spin to. Can be either a [[player]], [[ped]], [[object]], [[vehicle]] or a [[Element/Weapon|custom weapon]]. '''Server side supports only vehicles currently.'''
*'''theElement:''' The [[element]] to apply the spin to. Can be either a [[player]], [[ped]], [[object]], [[vehicle]] or a [[Element/Weapon|custom weapon]].
*'''rx:''' velocity around the X axis
*'''rx:''' velocity around the X axis
*'''ry:''' velocity around the Y axis
*'''ry:''' velocity around the Y axis
Line 25: Line 25:
addEventHandler ( "onColShapeHit", root, onColShapeHit )
addEventHandler ( "onColShapeHit", root, onColShapeHit )
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|1.5.5-9.14060|1.5.5-9.14060|}}


==See Also==
==See Also==
{{Element functions}}
{{Element functions}}

Latest revision as of 18:56, 29 October 2023

Sets the angular velocity of a specified, supported element (Applies a spin to it).

Syntax

bool setElementAngularVelocity ( element theElement, float rx, float ry, float rz )

OOP Syntax Help! I don't understand this!

Method: element:setAngularVelocity(...)
Variable: .angularVelocity
Counterpart: getElementAngularVelocity


Required Arguments

Returns

Returns true if it was succesful, false otherwise.

Example

function onColShapeHit ( thePlayer, matchingDimension )
    -- When a player hits the collision shape, give him a spin
    setElementAngularVelocity ( thePlayer, 0, 0, 20 )
end
addEventHandler ( "onColShapeHit", root, onColShapeHit )

Requirements

Minimum server version 1.5.5-9.14060
Minimum client version 1.5.5-9.14060

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.5.5-9.14060" client="1.5.5-9.14060" />

See Also