Garry's Mod Wiki

Vehicle:GetVehicleClass

string 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: 43ms

DB GetPage 7
Generate Html 2
SaveChanges (1) 18
Render Body 0
Render Sidebar 13