GetGlobalInt

From Garry's Mod
Jump to: navigation, search
 GetGlobalInt( )

Contents

Description

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

BUG

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

Issue Tracker: #3374

Arguments

string index

The unique index to identify the global value with.

Arguments

number default=0

The value to return if the global value is not set.

Returns

number

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

Examples

Example

Prints the current round number if set, otherwise 0.

print(GetGlobalInt("RoundNumber", 0))


Personal tools
Navigation