• Gamemode Scripting: Context menu won't open!
    2 replies, posted
I've been trying to create my first gamemode recently in GMOD. I haven't encountered many errors (yet), but I have no idea about this one. [B]Plain and simple, the context menu will not open[/B] Here is the code so far: init.lua: [CODE]AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( "shared.lua" ) function GM:PlayerLoadout(ply) ply:Give('weapon_crowbar') ply:Give('weapon_pistol') ply:Give('weapon_357') ply:Give('weapon_smg1') ply:Give('weapon_shotgun') ply:Give('weapon_frag') ply:Give('weapon_physcannon') ply:Give('weapon_crossbow') ply:GiveAmmo( 50, 'pistol', false ) ply:GiveAmmo( 12, '357', false ) ply:GiveAmmo( 75, 'SMG1', false ) ply:GiveAmmo( 20, 'Buckshot', false ) ply:GiveAmmo( 4, 'Grenade', false ) ply:GiveAmmo( 12, 'XBowBolt', false ) end function GM:PlayerSetModel( ply ) ply:SetModel("models/player/group01/male_07.mdl") end [/CODE] cl_init.lua [CODE]include ("shared.lua") function GM:ContextMenuOpen() return true end[/CODE] shared.lua: [CODE]GM.Name = "######" GM.Author = "KO #1" GM.Email = "N/A" GM.Website = "N/A" function GM:Initialize() -- Do stuff end[/CODE] In game, the context menu just won't open. The key is binded properly, there are no errors, it just doesn't work.
Context menu is a Sandbox feature, not a base feature. Same goes for the Q menu. Either derive your gamemode from sandbox, or copy / mimic it yourself.
[QUOTE=McDunkable;50579750]Context menu is a Sandbox feature, not a base feature. Same goes for the Q menu. Either derive your gamemode from sandbox, or copy / mimic it yourself.[/QUOTE] Okay, I'll do that when I get home.
Sorry, you need to Log In to post a reply to this thread.