Garry's Mod Wiki

util.FullPathToRelative_Menu

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

Description

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

Arguments

1 string gma
The Full path to the GMA file. like: "[Steam folder]\common\garrysmod\garrysmod\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 relativepath
The relative path to the GMA file.

Example

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

print( util.FullPathToRelative_Menu( "[Steam folder]\common\garrysmod\garrysmod\addons\[Name HERE].gma", "GAME" ) ) -- prints the relative path of the GMA file.
Output:
addons\[Name].gma