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?
[highlight](User was banned for this post ("Wrong forum" - mahalis))[/highlight]
Make your own Q menu. Make sure the gamemode is not deriving from sandbox.
Then do something like this
[code]
ply.CanQmenu = 1
-- and when the stage is over set ply.CanQmenu to 0
[/code]
[code]
function QMenu(ply)
if ply:KeyDown( KEY_Q ) then
if ply.CanQmenu == 1 then
-- HUD drawing and shit
else
Msg("Wait until the stage or whatever the fuck")
end
end
end
[/code]
^
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
Sorry, you need to Log In to post a reply to this thread.