HL2_campaign_azuze: Disableing 'Q' menu.

Im working on a campaign for gmod, now I have the gamemode present. But whats the code to disable the Q menu so people cant spawn things in the middle of the campaign?

(User was banned for this post ("Wrong forum" - mahalis))

Make your own Q menu. Make sure the gamemode is not deriving from sandbox.

Then do something like this

ply.CanQmenu = 1

-- and when the stage is over set  ply.CanQmenu to 0 

function QMenu(ply)
    if ply:KeyDown( KEY_Q ) then
          if ply.CanQmenu == 1 then
          -- HUD drawing and shit
          Msg("Wait until the stage or whatever the fuck")


This makes it so that you can only open the Q menu if the variable is 1. Otherwise it tells you to wait.

So basically for all players set that variable to 1 when you want them to use the menu and 0 (or anything else that isn’t 1) when you don’t.

k, thanks