Garry's Mod Wiki

Revision Difference

Global.GetGlobal2Int#547643

<function name="GetGlobal2Int" parent="Global" type="libraryfunc">⤶ <description>⤶ Returns an integer that is shared between the server and all clients.⤶ ⤶ <warning>The integer has a 32 bit limit. Use <page>Global.GetGlobalInt</page> for a higher limit</warning>⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="index" type="string">The unique index to identify the global value with.</arg>⤶ <arg name="default" type="number" default="0">The value to return if the global value is not set.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="number">The global value, or the default if the global value is not set.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Prints the current round number if set, otherwise 0.</description>⤶ <code>print(GetGlobalInt("RoundNumber", 0))</code>⤶ ⤶ </example>