SANDBOX/SpawnMenuOpen

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

Contents

Description

Called when spawnmenu is trying to be opened.

NOTE

Hiding the spawnmenu will not stop people from being able to use the various console commands to spawn in items, etc. See GM:PlayerSpawn* hooks for blocking actual spawning.

Returns

boolean

Return false to dissallow opening the spawnmenu

Examples

Example

Only allow the people you want to open the spawn menu.

local allowed = {
	["STEAM_0:0:00000000"] = true,
	["STEAM_0:0:10000000"] = true
}

hook.Add( "SpawnMenuOpen", "SpawnMenuWhitelist", function()
	if ( !allowed[ LocalPlayer():SteamID() ] ) then
		return false
	end
end )


Personal tools
Navigation