Vehicle/GetVehicleClass

From Garry's Mod
Jump to: navigation, search
 Vehicle:GetVehicleClass( )

Contents

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

string

The class name of the vehicle.

Examples

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 )


Personal tools
Navigation