• Show text only to your team! (DTextEntry)
    2 replies, posted
I am trying to figure out how chat.AddText will only show to your team. Not everyone. [CODE]--self:SetModel("models/player/Group03/male_"..math.random(1,9)..".mdl"), local ply = FindMetaTable("Player") local teams = {} teams[0] = { name = "Combine", color = Vector(255,255,255,0), weapons = {} } teams[1] = { name = "Rebels", color = Vector(255,255,255,0), weapons = {} } function ply:SetupTeam( n ) if (not teams[n] ) then return end self:SetTeam( n ) self:SetPlayerColor( teams[n].color ) end function openLobby() local frame = vgui.Create("DFrame") frame:SetSize(ScrW(),ScrH()) frame:Center() frame:SetVisible(true) frame:ShowCloseButton(false) frame:SetDraggable(false) frame:SetTitle("") frame:MakePopup() frame.Paint = function(s, w, h) draw.RoundedBox(0,0,0,w,h,Color(0,0,0,200)) end timer.Simple(300, function() frame:Close() end) local textbox = vgui.Create("DTextEntry", frame) textbox:SetPos(10, 850) textbox:SetTall( 20 ) textbox:SetWide( 450 ) textbox:SetEnterAllowed( true ) textbox.OnEnter = function() local ply = LocalPlayer() if chat.AddText( Color(255,255,255), ply:Name(), ": ", Color(255,255,255), textbox:GetValue()) then --Trying to figure what goes here in order to show ^ to the players current team end end net.Receive("open_lobby", openLobby)[/CODE]
Get the players team with ply:Team() and then check if the players you are sending the message to are in that team.
[QUOTE=MrRalgoman;52072573]Get the players team with ply:Team() and then check if the players you are sending the message to are in that team.[/QUOTE] ty!!!!
Sorry, you need to Log In to post a reply to this thread.