Garry's Mod Wiki

GetGlobalInt

number GetGlobalInt( string index, number default = 0 )

Description

Returns an integer that is shared between the server and all clients.

This function will not round decimal values as it actually networks a float internally.

Arguments

1 string index
The unique index to identify the global value with.
2 number default = 0
The value to return if the global value is not set.

Returns

1 number
The global value, or the default if the global value is not set.

Example

Prints the current round number if set, otherwise 0.

print(GetGlobalInt("RoundNumber", 0))

Page Links


Special Pages


Wikis

?

Render Time: 27ms

Session 0
DB GetPage 3
Generate Html 4
SaveChanges 8
Render Body 0
Render Sidebar 9