Garry's Mod Wiki



Used for serverlist.Query.


GameDir [string]

The game directory to get the servers for

Default: "garrysmod"

Type [string]

Type of servers to retrieve. Valid values are internet, favorite, history and lan

AppID [number]

Steam application ID to get the servers for

Default: 4000

Callback [function]

Called when a new server is found and queried. Arguments:

number ping - Latency to the server.

string name - Name of the server

string desc - "Nice" gamemode name

string map - Current map

number players - Total player number ( bot + human )

number maxplayers - Maximum reported amount of players

number botplayers - Amount of bots on the server

boolean pass - Whether this server has password or not

number lastplayed - Time when you last played on this server, as UNIX timestamp or 0

string address - IP Address of the server

string gamemode - Gamemode folder name

number workshopid - Gamemode Steam Workshop ID

boolean isanon - Is the server signed into an anonymous account?

string version - Version number, same format as jit.version_num

string localization - Two digit country code, us if nil

string gmcategory - Category of the gamemode, ex. pvp, pve, rp or roleplay

Return false to stop the query.

CallbackFailed [function]

Called if the query has failed, called with the servers IP Address

Finished [function]

Called when the query is finished. No arguments