engine/GetGames

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Improved return description)
(This has been fixed I believe)
 
Line 1: Line 1:
 
{{Func
 
{{Func
 
|Description=Returns an array of tables corresponding to all games from which Garry's Mod supports mounting content.
 
|Description=Returns an array of tables corresponding to all games from which Garry's Mod supports mounting content.
 
The "mounted" and "installed" values currently do not work correctly serverside on dedicated servers. Some games will always report true while others will always report false.
 
 
|Realm=Shared and Menu
 
|Realm=Shared and Menu
 
|IsClass=No
 
|IsClass=No

Latest revision as of 12:30, 9 May 2019

 engine.GetGames( )

Contents

Description

Returns an array of tables corresponding to all games from which Garry's Mod supports mounting content.

Returns

table

A table of tables containing all mountable games

Examples

Example

Prints out a list of games, their Steam AppIds, titles and status (owned, installed, mounted).

PrintTable( engine.GetGames() )

Output:

1:
 depot = 220
 title = Half-Life 2
 owned = true
 folder = hl2
 mounted = true
 installed = true
2:
 depot = 240
 title = Counter-Strike
 owned = false
 folder = cstrike
 mounted = false
 installed = false
3:
 depot = 300
 title = Day of Defeat
 owned = false
 folder = dod
 mounted = false
 installed = false
4:
 depot = 440
 title = Team Fortress 2
 owned = true
 folder = tf
 mounted = true
 installed = true
Personal tools
Navigation