Garry's Mod Wiki

util.RelativePathToFull_Menu

  string util.RelativePathToFull_Menu( string gma, string gamePath = "GAME" )

Description

Converts the relative path of the given GMA file to the Full Path.
You can use util.FullPathToRelative_Menu to convert the Full path back to the Relative Path.

Arguments

1 string gma
The Relative path to the GMA file. like: "addons/[Name].gma"
2 string gamePath = "GAME"
The path to look for the files and directories in. See this list for a list of valid paths.

Returns

1 string fullpath
The full path to the GMA file.

Example

Searches for a .gma file in your addons folder and converts the path to a full path.

local files, _ = file.Find( "addons/*.gma", "GAME" ) local file = "addons/" .. files[1] -- gets the first file and converts it into the relative path. print( util.RelativePathToFull_Menu( file ) ) -- prints the full path of the GMA file.
Output:
[Steam folder]\common\garrysmod\garrysmod\addons\[Name].gma