Garry's Mod Wiki

util.RelativePathToGMA_Menu

  table util.RelativePathToGMA_Menu( string gma )

Description

Returns the AddonInfo of the Addon the given file belongs to.

Arguments

1 string gma
The Full path to the GMA file. like: "[Steam folder]\common\garrysmod\garrysmod\addons[Name].gma"

Returns

1 table addoninfo
The AddonInfo of the GMA file. Will return nil if the File doesn't belongs to an addon. Table Structure:
Author = [Addon Author] File = [Steam folder]\workshop\content\4000\[Addon ID]/[GMA Name].gma ID = [Addon ID] Title = [Addon Title]

Example

Prints the AddonInfo of the given Path (The Addon the file belongs to.)

PrintTable( util.RelativePathToGMA_Menu( "[Insert here something from an addon like a Model]" ) ) -- prints the AddonInfo
Output:
Author = [Addon Author] File = [Steam folder]\workshop\content\4000\[Addon ID]/[GMA Name].gma ID = [Addon ID] Title = [Addon Title]