The open.mp logo
Home
FAQ
Forums
Servers
Partners
Docs
Blog

warning Not Translated

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

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

GetVehicleModel

Description

Gets the model ID of a vehicle.

NameDescription
vehicleidThe ID of the vehicle to get the model of.

Returns

The vehicle's model ID, or 0 if the vehicle doesn't exist.

Examples

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 411) // 411 is the Infernus model
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Nice Infernus!");
    }
    return 1;
}

Related Functions

  • GetPlayerVehicleID: Get the ID of the vehicle the player is in.
  • GetVehiclePos: Get the position of a vehicle.
  • GetVehicleZAngle: Check the current angle of a vehicle.
  • GetPlayerVehicleSeat: Check what seat a player is in.

Community

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

More

  • SA-MP
  • Blog
  • GitHub