Gamemode.SpawnMenuOpen

From GMod Wiki

Jump to: navigation, search
Gamemode Function: Gamemode.SpawnMenuOpen
Gamemode.SpawnMenuOpen is a function that is defined in the Sandbox Gamemode and its derivatives.
Event Hook
Hook NameSpawnMenuOpen
SyntaxGM:SpawnMenuOpen( )
DescriptionCalled when a player opens the Spawn Menu
ReturnsNil
Lua StateNewerMissing.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.SpawnMenuOpen]Gamemode.SpawnMenuOpen [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionDisallows the player to open the Spawn Menu.
Used onNewerClient.png
Code
 
local function DisallowSpawnMenu( )
	return false
end
 
hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", DisallowSpawnMenu)
OutputN/A


DescriptionOnly admins can open the Spawn Menu.
Used onNewerClient.png
Code
 
local function DisallowSpawnMenu( )
	if not LocalPlayer():IsAdmin() then
		return false
	end
end
 
hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", DisallowSpawnMenu)
OutputN/A



See Also

Gamemode.OnSpawnMenuClose

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox