GM:Initialize

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

Description

Called after the gamemode loads and starts.

Examples

Example

"hi" will be printed to the console when the gamemode initializes.

function GM:Initialize()
	print("hi" )
end

-- That way you are overriding the default hook
-- you can use hook.Add to make more functions get called on initialization
local function init()
	print("Initialization hook called")
end
hook.Add( "Initialize", "some_unique_name", init )

Output:

Initializtion hook called
hi
Personal tools
Navigation