ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
shared

GetVehicleClass

FiveM shared native documentation with a Lua example.

Summary

Returns the class of a vehicle (compacts, SUVs, super, motorcycles, etc.) as a number. Used for class-based rules like insurance, racing categories, or job restrictions.

Returns

number — the vehicle class ID (0-21+).

Parameters

vehiclenumberThe vehicle handle.

Example

local class = GetVehicleClass(veh)
if class == 8 then -- motorcycles
  -- e.g. require helmet
end

Common pitfalls

  • Class IDs are fixed by GTA; keep a reference table rather than guessing numbers.
  • Useful for pricing and racing category logic.

Related natives

Related guides

Managing jobs on your server?

Viper Multi-Job lets players hold several jobs and switch between them with grade, salary and duty handled — QBCore, QBox and ESX, validated server-side.

See Viper Multi-Job →