SetVehicleRotation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
==Description==
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.
This function rotates a vehicle around a single point.  


==Syntax==
==Syntax==
Line 11: Line 11:
*'''y''': The y-axis rotation in degrees.
*'''y''': The y-axis rotation in degrees.
*'''z''': The z-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==
==Example==
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 )  
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 )  
if ( SetVehicleRotation ( newcar, 0, 0, 270 ) )
if ( SetVehicleRotation ( newcar, 0, 0, 270 ) ) then
  outputChatBox ( "Rotation change successful." )
  outputChatBox ( "Rotation change successful." )
end</syntaxhighlight>
end</syntaxhighlight>

Revision as of 12:47, 1 August 2007

Description

This function rotates a vehicle around a single point.

Syntax

SetVehicleRotation ( vehicle, rx, ry, rz )

Required Arguments

  • vehicle: 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

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

See Also