RedM Natives

GET_VEHICLE_TYPE

Returns the type of the passed vehicle.

Hash0xA273060E
Runtime nameGetVehicleType
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

char* GET_VEHICLE_TYPE(Vehicle vehicle);

Parameters

NameTypeDescription
vehicleVehicle

The vehicle's entity handle.

Returns char* — If the entity is a vehicle, the vehicle type. If it is not a vehicle, the return value will be null.

Description

Cfx.re native reference

Returns the type of the passed vehicle.

For client scripts, reference the more detailed GET_VEHICLE_TYPE_RAW native.

Vehicle types

  • automobile
  • bike
  • boat
  • heli
  • plane
  • submarine
  • trailer
  • train

Usage

Lua
local retval = GetVehicleType(vehicle)

-- always works, by hash
local retval = Citizen.InvokeNative(0xa273060e, vehicle, Citizen.ResultAsString())
JavaScript and C#
JavaScript
const retval = GetVehicleType(vehicle);

// by hash
const retval = Citizen.invokeNative('0xa273060e', vehicle, Citizen.returnResultAnyway(), Citizen.resultAsString());
C#
string retval = Function.Call<string>((Hash)0xa273060e, vehicle);

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.