SetVehicleRotation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (Changed "DeprecatedWithAlt" template to "Deprecated")
 
(20 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
{{Server client function}}
This function rotates a vehicle around a single point. The function returns a boolean value (true or false) that tells you if it was successful or not.
{{Deprecated|setElementRotation|}}
 
This function rotates a vehicle around a single point.  


==Syntax==
==Syntax==
bool [[SetVehicleRotation]] ( [[vehicle]] vehicle, float rx, float ry, float rz )
<syntaxhighlight lang="lua">bool setVehicleRotation ( vehicle theVehicle, rx, ry, rz )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''vehicle''': The [[vehicle]] that you wish to apply the warp to.
*'''theVehicle''': The [[vehicle]] that you wish to apply the warp to.
*'''x''': The x-axis rotation in radians.
*'''x''': The x-axis rotation in degrees.
*'''y''': The y-axis rotation in radians.
*'''y''': The y-axis rotation in degrees.
*'''z''': The z-axis rotation in radians.
*'''z''': The z-axis rotation in degrees.
{{UsingRadians}}
 
==Returns==
Returns a boolean value ''true'' or ''false'' that tells you if it was successful or not.


==Example==
==Example==
<syntaxhighlight lang="lua">local newcar = createVehicle ( 520, 1024, 1024, 1024 )
if setVehicleRotation ( newcar, 0, 0, 270 ) then
    outputChatBox ( "Rotation change successful." )
end</syntaxhighlight>


newcar = [[createVehicle]] ( 520, 1024, 1024, 1024 )
==See Also==
{{Vehicle functions}}
if ([[SetVehicleRotation]] ( newcar, 0.543,2.335,3.127 ))
  [[serverChat]] ( "Rotation change successful." )
end

Latest revision as of 16:18, 13 February 2015

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


This function rotates a vehicle around a single point.

Syntax

bool setVehicleRotation ( vehicle theVehicle, rx, ry, rz )

Required Arguments

  • theVehicle: The vehicle that you wish to apply the warp to.
  • x: The x-axis rotation in degrees.
  • y: The y-axis rotation in degrees.
  • z: The z-axis rotation in degrees.

Returns

Returns a boolean value true or false that tells you if it was successful or not.

Example

local newcar = createVehicle ( 520, 1024, 1024, 1024 ) 
if setVehicleRotation ( newcar, 0, 0, 270 ) then
    outputChatBox ( "Rotation change successful." )
end

See Also