SetVehicleTurnVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
[[Category:Incomplete]]
[[Category:Incomplete]]


__NOTOC__  
__NOTOC__
{{Server client function}}
{{Server client function}}
This fake function is for use with blah & blah and does blahblahblabhalbhl
Sets the angular velocity of a vehicle. Basically applies a spin to it.


==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>  


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''theVehicle:''' 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 blah, ''false'' otherwise.


==Example==  
==Example==
<section name="Server" class="server" show="true">
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 = getPlayerOccupiedVehicle ( 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>
</section>


==See Also==
==See Also==
{{FunctionArea_Functions}}
{{FunctionArea_Functions}}

Revision as of 19:15, 15 August 2007

Dialog-information.png This article needs checking.

Reason(s): We need a min-max values allowed or a recommended min-max/relevant range?

--Ransom 02:46, 11 April 2007 (CDT)


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

Syntax

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

Required Arguments

  • theVehicle: 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 blah, false otherwise.

Example

function onColShapeHit ( thePlayer, matchingDimension )
    -- When a player hits the collision shape, check if he's in a vehicle
    local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )
    if playerVehicle ~= false then
        -- If so, give it a spin
        setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 )
    end
end
addEventHandler ( "onColShapeHit", getRootElement ( ), onColShapeHit )

See Also

Template:FunctionArea Functions