Garry's Mod Wiki

system

The system library provides functions that allow you to gather information about the system running the game, such as operating system, uptime and battery level.

Methods

number system.AppTime()
Returns the total uptime of the current application as reported by Steam. This will return a similar value to SysTime. This function does not work on Dedicated Servers and will instead return no value.
number system.BatteryPower()
Returns the current battery power.
system.FlashWindow()
Flashes the window, turning the border to white briefly
string system.GetCountry()
Returns the country code of this computer, determined by the localisation settings of the OS. This function does not work on Dedicated Servers and will instead return no value.
boolean system.HasFocus()
Returns whether or not the game window has focus. This function does not work on dedicated servers and will instead return no value.This will return true when minimized in windowed-mode.Issue Tracker: 2424
boolean system.IsLinux()
Returns whether the current OS is Linux.
boolean system.IsOSX()
Returns whether the current OS is OSX.
boolean system.IsWindowed()
Returns whether the game is being run in a window or in fullscreen (you can change this by opening the menu, clicking 'Options', then clicking the 'Video' tab, and changing the Display Mode using the dropdown menu):
boolean system.IsWindows()
Returns whether the current OS is Windows.
number system.SteamTime()
Returns the synchronized Steam time. This is the number of seconds since the Unix epoch. This function does not work on Dedicated Servers and will instead return no value.
number system.UpTime()
Returns the amount of seconds since the Steam user last moved their mouse. This is a direct binding to ISteamUtils->GetSecondsSinceComputerActive, and is most likely related to Steam's automatic "Away" online status. This function does not work on Dedicated Servers and will instead return no value.

Page Links


Special Pages


Wikis

?

Render Time: 66ms

DB GetPage 48
Generate Html 2
SaveChanges (1) 9
Render Body 0
Render Sidebar 5