Garry's Mod Wiki

Revision Difference

util.FullPathToRelative_Menu#549127

<function name="FullPathToRelative_Menu" parent="util" type="libraryfunc">⤶ <description>⤶ Converts the Full path of the given GMA file to the Relative Path. ⤶ You can use <page>util.RelativePathToFull_Menu</page> to convert the Relative path back to the Full Path.⤶ </description>⤶ <realm>Menu</realm>⤶ <args>⤶ <arg name="gma" type="string">The **Full** path to the GMA file. **like: "[Steam folder]\common\garrysmod\garrysmod\addons\[Name].gma"**</arg>⤶ <arg name="gamePath" type="string" default="GAME">The path to look for the files and directories in. See <page text="this list">File_Search_Paths</page> for a list of valid paths.</arg>⤶ </args>⤶ <rets>⤶ <ret name="relativepath" type="string">The relative path to the GMA file.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Searches for a .gma file in your addons folder and converts the path to a full path.</description>⤶ <code>⤶ print( util.FullPathToRelative_Menu( "[Steam folder]\common\garrysmod\garrysmod\addons\[Name HERE].gma", "GAME" ) ) -- prints the relative path of the GMA file.⤶ </code>⤶ <output>⤶ ```lua⤶ addons\[Name].gma⤶ ```⤶ </output>⤶ </example>