Garry's Mod Wiki

Vehicle:GetVehicleClass

Description

Returns the vehicle class name. This is only useful for Sandbox spawned vehicles or any vehicle that properly sets the vehicle class with Vehicle:SetVehicleClass.

Returns

1 string
The class name of the vehicle.

Example

Prints the spawn menu name of the vehicle the player is currently in.

local c = Entity(1):GetVehicle():GetVehicleClass() if ( !list.Get( "Vehicles" )[ c ] ) then return end local t = list.Get( "Vehicles" )[ c ] print( t.Name )

Page Links


Special Pages


Wikis

?

Render Time: 29ms

Session 0
DB GetPage 4
Generate Html 3
SaveChanges 8
Render Body 0
Render Sidebar 12