SetVehicleRotation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


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


===Required Arguments===
===Required Arguments===
*'''vehicle''': The [[vehicle]] that you wish to apply the warp to.
*'''vehicle''': The vehicle that you wish to apply the warp to.
*'''x''': The x-axis rotation in degrees.
*'''x''': The x-axis rotation in degrees.
*'''y''': The y-axis rotation in degrees.
*'''y''': The y-axis rotation in degrees.
Line 13: Line 13:


==Example==
==Example==
 
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 )  
newcar = [[createVehicle]] ( 520, 1024, 1024, 1024 )
if ( SetVehicleRotation ( newcar, 0, 0, 270 ) )
serverChat ( "Rotation change successful." )
if ( [[SetVehicleRotation]] ( newcar, 0, 0, 270 ) )
end</syntaxhighlight>
  [[serverChat]] ( "Rotation change successful." )
end

Revision as of 02:46, 18 May 2006

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.

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.

Example

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