Skip to content

Commit d48b695

Browse files
authored
Add no_teamchat (#40)
1 parent 535dbb5 commit d48b695

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
if engine.ActiveGamemode() ~= "sandbox" then return end -- Other gamemodes will actually have a use for teamchat
2+
3+
local ranks = {
4+
user = true,
5+
regular = true
6+
}
7+
8+
hook.Add( "PlayerCanSeePlayersChat", "GmodScripts_PublicTeamChat", function( _text, team, _listener, speaker )
9+
local usergroup = speaker:GetUserGroup()
10+
if not ranks[usergroup] then return end
11+
if team then return true end
12+
end )

0 commit comments

Comments
 (0)