SetElementAngularVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(First creation (please check if that info is correct, i am no c++ expert))
 
mNo edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
Sets the angular velocity of a supported element (Applies a spin to it).
{{New feature/item|3.0156|1.5.5|14060|Sets the angular velocity of a specified, supported element (Applies a spin to it).}}


==Syntax==  
==Syntax==  

Revision as of 22:56, 27 August 2018

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

  • theElement: The element to apply the spin to. Can be either a player, ped, object, vehicle or a custom weapon. Server side supports only vehicles currently.
  • rx: velocity around the X axis
  • ry: velocity around the Y axis
  • rz: velocity around the Z axis

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 )

See Also