GM:OnSpawnMenuOpen

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

Contents

Description

Called when a player presses the "+menu" bind on their keyboard, which is bound to Q by default.

Returns

boolean

Allow the player to open the spawn menu or not.

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( "OnSpawnMenuOpen", "SpawnMenuWhitelist", function()
	if ( !allowed[ LocalPlayer():SteamID() ] ) then
		return false
	end
end )


Personal tools
Navigation