Garry's Mod Wiki

surface.GetTextureID

  number surface.GetTextureID( string name/path )

Description

Returns the texture id of the material with the given name/path, for use with surface.SetTexture.

Opposite version of this function is surface.GetTextureNameByID.

This function will not work with .png or .jpg images. For that, see Material. You will probably want to use it regardless.

Arguments

1 string name/path
Name or path of the texture.

Returns

1 number
The texture ID