SetVehicleAngularVelocity

From SA-MP Wiki

Jump to: navigation, search


SetVehicleAngularVelocity was added in SA-MP 0.3b This function was added in SA-MP 0.3b and will not work in earlier versions!


Description:

Sets the angular X, Y and Z velocity of a vehicle


Image:32px-Circle-style-warning.png

Important
Note

This function has no effect on unoccupied vehicles and does not affect trains.


Parameters:
(vehicleid, Float:X, Float:Y, Float:Z)
vehicleidThe ID of the vehicle to set the velocity of.
Float:XThe amount of velocity in the angular X direction.
Float:YThe amount of velocity in the angular Y direction .
Float:ZThe amount of velocity in the angular Z direction.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. The vehicle does not exist.


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/spin", cmdtext))
    {
	if(IsPlayerInAnyVehicle(playerid))
        SetVehicleAngularVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 2.0);
	return 1;
    }
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools
Navigation
Toolbox
In other languages