SetVehicleTurnVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(Deprecated method in favor of setElementAngularVelocity)
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Needs_Checking|We need a min-max values allowed or a recommended min-max/relevant range?
__NOTOC__
--[[User:Ransom|Ransom]] 02:46, 11 April 2007 (CDT)}}
{{Server client function}}
{{Deprecated|setElementAngularVelocity|}}
Sets the angular velocity of a vehicle. Basically applies a spin to it.


[[Category:Incomplete]]
{{Deprecated feature|3.0156|1.5.6|This function will be deprecated in '''1.5.6''', use [[setElementAngularVelocity]] in the future.}}
 
__NOTOC__
This fake function is for use with blah & blah and does blahblahblabhalbhl


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setVehicleTurnVelocity ( element vehicle, float rx, float ry, float rz )           
bool setVehicleTurnVelocity ( vehicle theVehicle, float rx, float ry, float rz )           
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[vehicle]]:setTurnVelocity|turnVelocity|getVehicleTurnVelocity}}
===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''theVehicle:''' The [[vehicle]] to apply the spin to.
 
*'''rx:''' velocity around the X axis
===Optional Arguments===
*'''ry:''' velocity around the Y axis
{{OptionalArg}}
*'''rz:''' velocity around the Z axis
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns ''true'' if it was succesful, ''false'' otherwise.


==Example==  
==Example==
This example does...
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function onColShapeHit ( thePlayer, matchingDimension )
blabhalbalhb --abababa
    -- When a player hits the collision shape, check if he's in a vehicle
--This line does this...
    local playerVehicle = getPedOccupiedVehicle ( thePlayer )
mooo
    if playerVehicle ~= false then
        -- If so, give it a spin
        setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 )
    end
end
addEventHandler ( "onColShapeHit", getRootElement ( ), onColShapeHit )
</syntaxhighlight>
</syntaxhighlight>


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

Latest revision as of 15:58, 8 November 2018

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use setElementAngularVelocity instead.

Sets the angular velocity of a vehicle. Basically applies a spin to it.

Syntax

bool setVehicleTurnVelocity ( vehicle theVehicle, float rx, float ry, float rz )           

OOP Syntax Help! I don't understand this!

Method: vehicle:setTurnVelocity(...)
Variable: .turnVelocity
Counterpart: getVehicleTurnVelocity


Required Arguments

  • theVehicle: The vehicle to apply the spin to.
  • 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, check if he's in a vehicle
    local playerVehicle = getPedOccupiedVehicle ( thePlayer )
    if playerVehicle ~= false then
        -- If so, give it a spin
        setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 )
    end
end
addEventHandler ( "onColShapeHit", getRootElement ( ), onColShapeHit )

See Also