open.mp | SetVehicleVelocity
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文
warning Not Translated

This page has not been translated into the language that your browser requested. The English content is being shown as a fallback.

If you want to contribute a translation for this page then please click here.

SetVehicleVelocity

warning

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

Description

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

NameDescription
vehicleidThe ID of the vehicle to set the velocity of.
Float:XThe velocity in the X direction.
Float:YThe velocity in the Y direction .
Float:ZThe velocity in the Z direction.

Returns

1: The function executed successfully.

0: The function failed to execute. The vehicle does not exist.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/jump", cmdtext))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.2);
        }
        return 1;
    }
}

Notes

warning

This function has no affect on un-occupied vehicles and does not affect trains.

Related Functions

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub