From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(This isn't true. While returning false will block it, so will returning true - it's just the mechanics of how hooks work.)
Line 3: Line 3:
|desc=Allow the player to open the spawn menu or not.
|Description=Only allow the people you want to open the spawn menu.
|Code=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 )

Latest revision as of 19:31, 9 December 2018

 GM:OnSpawnMenuOpen( )


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

Personal tools