getVehicleClass
GET_VEHICLE_CLASS0x29439776AAA00A62The GTA V native GET_VEHICLE_CLASS of the VEHICLE namespace, as LS:MP client scripts call it: the global function getVehicleClass, in JavaScript and in Lua.
getVehicleClass(vehicle: Vehicle): numbergetVehicleClass(vehicle: Vehicle): integerUsage
JavaScript
const result = getVehicleClass(vehicle);Lua
local result = getVehicleClass(vehicle)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
vehicle | Vehicle | number | integer |
Returns
int JavaScript number, Lua integerNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns an int
Vehicle Classes:
0: Compacts
1: Sedans
2: SUVs
3: Coupes
4: Muscle
5: Sports Classics
6: Sports
7: Super
8: Motorcycles
9: Off-road
10: Industrial
11: Utility
12: Vans
13: Cycles
14: Boats
15: Helicopters
16: Planes
17: Service
18: Emergency
19: Military
20: Commercial
21: Trains
char buffer[128];
std::sprintf(buffer, "VEH_CLASS_%i", getVehicleClass(vehicle));
const char* className = getFilenameForAudioConversation(buffer);Reference
- Namespace
- Vehicle VEHICLE
- In the game
int GET_VEHICLE_CLASS(Vehicle vehicle)- Hash
0x29439776AAA00A62