Garry's Mod Wiki

MatSelect:AddMaterialEx

  MatSelect:AddMaterialEx( string label, string path, any value, table convars )

Description

Adds a new material to the selection list, with some extra options.

Arguments

1 string label
Tooltip for the material, for when the player hovers over the material.
2 string path
Path to the material. Relative to materials/ folder (do not include it), and do not include the .vmt extension.
3 any value
Overrides the "value" of the material. This will be what MatSelect:OnSelect receives in the first argument. It also affects MatSelect:FindMaterialByValue.
4 table convars
A list of convar names (as keys) and their values to set when the user selects this material. ContextBase:SetConVar will be ignored.