SetVehicleVelocity
From SA-MP Wiki
Description:
Sets the X, Y and Z velocity of a vehicle.
(vehicleid, Float:X, Float:Y, Float:Z)
vehicleid | The ID of the vehicle to set the velocity of. |
Float:X | The velocity in the X direction. |
Float:Y | The velocity in the Y direction . |
Float:Z | The velocity in the Z direction. |
Return Values:
- 1: The function executed successfully.
- 0: The function failed to execute. The vehicle does not exist.
Example Usage:
public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/jump", cmdtext)) { if(IsPlayerInAnyVehicle(playerid)) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.2); return 1; } }
- SetPlayerVelocity: Set a player's velocity.
- GetPlayerVelocity: Get a player's velocity.
- GetVehicleVelocity: Get a vehicle's velocity.
- SetVehicleAngularVelocity: Set the angular velocity of a vehicle.