Scripting/Squirrel/Functions/Vehicles/Angle

From VC-MP Wiki

Jump to: navigation, search

NOTE: This function has been modified in VC:MP 0.3z r2. It may work as in previous versions, and offer additional functionality.


This instance variable returns or sets the rotation of the vehicle. Note: Since R2 it's been possible to set the vehicle rotation.

Syntax

float Vehicle.Angle

Vehicle.Angle = float fNewAngle

Example 1. Returning

This command allows you to know the angle of the vehicle

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "vehangle" )
     {
         local veh = FindVehicle( text.tointeger() );
         if ( !veh ) PrivMessage( "Error: Wrong ID of the vehicle.", player );
         else {
             PrivMessage( "Vehicle:( " + veh + " ) ID:( " + veh.ID + " ) Angle:( " + veh.Angle + " )), player );
         }
     }
 
}

Notes

TODO

Example 2. Setting

This function needs an example. You can help us complete the wiki by writing one, or maybe even two :o

TODO

Notes

TODO

Related Functions

Personal tools
squirrel scripting