GetVehicleTurretPosition: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→Syntax) |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">float float getVehicleTurretPosition ( vehicle )</syntaxhighlight> | ||
This function also has two variants that allow you to retrieve data from just one of the two axes. | This function also has two variants that allow you to retrieve data from just one of the two axes. | ||
{{UsingRadians}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''vehicle''': The vehicle whose rotation you want to retrieve. | *'''vehicle''': The vehicle whose rotation you want to retrieve. | ||
===Returns=== | |||
Returns two [[float]]s for the X and Y axis rotation respectively. | |||
==Example== | ==Example== |
Revision as of 22:56, 18 May 2006
Description
This function returns two floats containing the rotational position of the vehicle's turret along the horizontal and vertical axes (X and Y) respectively. This function can fail if the player is not in a vehicle, or if the vehicle does not have a turret. Vehicles with turrets include tanks and fire trucks. If this function does fail, the first argument will be set to 'false'.
Syntax
float float getVehicleTurretPosition ( vehicle )
This function also has two variants that allow you to retrieve data from just one of the two axes.
Required Arguments
- vehicle: The vehicle whose rotation you want to retrieve.
Returns
Returns two floats for the X and Y axis rotation respectively.
Example
newcar = createVehicle ( 520, 1024, 1024, 1024 ) x, y = GetVehicleTurretPosition ( newcar ) if (x) serverChat ( "Turret position: ",x,",",y,"." ) end