Garry's Mod Wiki

Revision Difference

util.RelativePathToFull_Menu#549126

<function name="RelativePathToFull_Menu" parent="util" type="libraryfunc">⤶ <description>⤶ Converts the relative path of the given GMA file to the Full Path. ⤶ You can use <page>util.FullPathToRelative_Menu</page> to convert the Full path back to the Relative Path.⤶ </description>⤶ <realm>Menu</realm>⤶ <args>⤶ <arg name="gma" type="string">The Relative path to the GMA file. **like: "addons/[Name].gma"**</arg>⤶ </args>⤶ <rets>⤶ <ret name="fullpath" type="string">The full 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>⤶ 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.⤶ </code>⤶ <output>⤶ ```lua⤶ c:\program files (x86)\steam\steamapps\common\garrysmod\garrysmod\addons\[Name].gma⤶ ```⤶ </output>⤶ </example>