Disable the 'Q' menu for one team.

How would u go about disabling the Q menu for one team? heres what i got so far, but multiple people have looked at it, and can’t figure it out. What am i doing wrong?

cl_init.lua:



------------------------------------------------------------------
function GAMEMODE:SpawnMenuOpen(ply)

	GAMEMODE:AddHint( "OpeningContext", 20 )
	if (player.CanBuild ==1) then
return true
else return false
end

end
 hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", DisallowSpawnMenu)
 ----------------------------------------------------------------------------


init.lua



  -------------------------------------------------------------------------
 function team_1( ply ) 
 
     ply:SetTeam( 1 ) //Make the player join team 1
	 ply:StripWeapons( )
	 ply:Spawn()
	 player.CanBuild = 1

 end 
 -------------------------------------------------------------------------
 function team_2( ply ) 
 
     ply:SetTeam( 2 ) //Make the player join team 2
	 ply:StripWeapons( )	 
	 ply:Spawn()
	 player.CanBuild = 0
 end 
 --------------------------------------------------------------------------


Full scripts:
shared: http://pastebin.com/m6defab79
cl_init: http://pastebin.com/m1c259253
init: http://pastebin.com/m150d300

Thanks in advanced for everyeone who helps out.
EDIT: Btw, i don’t get an error of any sort. It just does not work.

cl_init.lua:
[lua]function GAMEMODE:SpawnMenuOpen(ply)
GAMEMODE:AddHint( “OpeningContext”, 20 )
if (LocalPlayer():Team() ==1) then
return true
else
return false
end
end
hook.Add( “SpawnMenuOpen”, “DisallowSpawnMenu”, DisallowSpawnMenu)[/lua]

you won’t even need player.CanBuild in init.lua anymore. if you wanted both the client and the server to have the variable it should’ve been defined in shared.lua.

Thanks, it worked!

Remember that without q menu you still can “hack” his features…