GetVehicleClass

From GT-MP
Jump to: navigation, search
GetVehicleClass
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

Gets the vehicle class associated with the given vehicle hash. See Vehicle Classes for a list of classes.


Syntax

API.getVehicleClass(VehicleHash model);

Required Arguments

  • model: parameter input should be in VehicleHash type.

NOTE: This function returns data in int type.

Usage example(s)

In Javascript
Client-Side Function

var player = API.getLocalPlayer();
var vehicle = API.getPlayerVehicle(player);
if (!vehicle.IsNull) {
  var vehicleClass = API.getVehicleClass(API.getEntityModel(vehicle));
  API.sendChatMessage("Vehicle class: ~r~" + vehicleClass);
}


References