Garry's Mod Wiki

VehicleTable

Description

Table structure passed to SANDBOX:PlayerSpawnVehicle, describing a spawnable Vehicle in Sandbox gamemode.

Example usage in defined a custom spawnable vehicle:

list.Set( "Vehicles", "Jeep", { -- Required information Name = "Jeep", Model = "models/buggy.mdl", Class = "prop_vehicle_jeep_old", Category = "Half-Life 2", -- Optional information Author = "VALVe", Information = "The regular old jeep", KeyValues = { vehiclescript = "scripts/vehicles/jeep_test.txt" } } )

Members

string Class
Entity class name for this vehicle.
string Name
Nice name for this vehicle, for UI purposes.
string Model
Model of the vehicle.
table KeyValues
A list of key-value pairs to apply to the vehicle entity. Possible valid keys that can be set are:
  • vehiclescript
  • limitview
  • vehiclelocked
  • cargovisible
  • enablegun
number Offset
Offset away the surface player is looking at to spawn at.

Default: nil

table Members
Set these members on the spawned vehicle's table (Entity:GetTable) to given values.

Default: nil

string Author
Author of the vehicle, for UI purposes.

Default: ""

string Category
Category of this vehicle, for UI purposes.

Default: "Other"

string Information
A small description of the vehicle, for UI purposes.

Default: ""