GetVehicleTurnVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Deprecated again with better template)
 
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Server client function}}
{{Server client function}}
{{Deprecated|getElementAngularVelocity|}}
__NOTOC__
__NOTOC__
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
This function is used to retrieve a vehicle's turning velocity for each axis.
This fake function is for use with blah & blah and does blahblahblabhalbhl


==Syntax==  
==Syntax==  
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
float float float getVehicleTurnVelocity ( vehicle theVehicle )
float float float getVehicleTurnVelocity ( vehicle theVehicle )
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[vehicle]]:getTurnVelocity|turnVelocity|setVehicleTurnVelocity}}
===Required Arguments===  
===Required Arguments===  
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->
*'''theVehicle:''' The [[vehicle]] you wish to get the turning velocities of.
*'''argumentName:''' description


<!-- Only include this section below if there are optional arguments -->
===Returns===
===Optional Arguments===  
Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis or ''false'' if wrong arguments were passed.
{{OptionalArg}}
*'''argumentName2:''' description
*'''argumentName3:''' description


===Returns===
===Example===
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check -->
<section name="Server" class="server" show="true">
*Returns ''true'' if blah, ''false'' otherwise.
This example shows the current turn velocity of the vehicle that you're in.
*x, y, z


==Example==
<!-- Explain what the example is in a single sentance -->
This example does...
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function velocity(player)
blabhalbalhb --abababa
    if not isPedInVehicle(player) then return end
--This line does this...
    local veh = getPedOccupiedVehicle(player)
mooo
    local vx, vy, vz = getVehicleTurnVelocity(veh)
    outputChatBox("Vehicle's turn velocity is: X: "..vx.." Y: "..vy.." Z: "..vz, player, 0, 255, 0, false)
end
addCommandHandler("geturnvelocity",velocity,false,false)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
 
{{FunctionArea_functions}}
{{Vehicle functions}}
[[Category:Incomplete]] -- leave this unless you complete the function

Latest revision as of 22:56, 29 April 2024

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 getElementAngularVelocity instead.


This function is used to retrieve a vehicle's turning velocity for each axis.

Syntax

float float float getVehicleTurnVelocity ( vehicle theVehicle )

OOP Syntax Help! I don't understand this!

Method: vehicle:getTurnVelocity(...)
Variable: .turnVelocity
Counterpart: setVehicleTurnVelocity


Required Arguments

  • theVehicle: The vehicle you wish to get the turning velocities of.

Returns

Returns 3 floats that represent the vehicle's turning velocity on the x, y and z axis or false if wrong arguments were passed.

Example

Click to collapse [-]
Server

This example shows the current turn velocity of the vehicle that you're in.

function velocity(player)
    if not isPedInVehicle(player) then return end
    local veh = getPedOccupiedVehicle(player)
    local vx, vy, vz = getVehicleTurnVelocity(veh)
    outputChatBox("Vehicle's turn velocity is: X: "..vx.." Y: "..vy.." Z: "..vz, player, 0, 255, 0, false)
end
addCommandHandler("geturnvelocity",velocity,false,false)

See Also