• One to One chat boxes
    0 replies, posted
So I am working on a project and I have ran into a problem and request an example. My end result I am looking for is a button that you press that will open up a chat box with tabs for each "Client Report". If a non-admin presses the button on their HUD it will open a chatbox for the client and another tab for the admin (if it's open). Then they can go back and forth chatting. So far I've this on the client side: [lua] function ClientReport() ClientPanel = vgui.Create( "DFrame" ) ClientPanel:SetSize( 300, 400 ) ClientPanel:SetPos( (ScrW()/2) - 150, (ScrH()/2) - 200 ) ClientPanel:ShowCloseButton( true ) ClientPanel:SetTitle( "Client -> Admin Report" ) ClientPanel:SetDraggable( true ) ClientPanel:SetVisible( false ) ClientButton = vgui.Create( "DButton" ) ClientButton:SetPos( 25, ScrH()*0.827 ) ClientButton:SetSize( 50, 20 ) ClientButton:SetText( "Report" ) ClientButton.DoClick = function() ClientPanel:SetVisible( true ) ClientPanel:MakePopup() end ClientChat = vgui.Create( "DTextEntry", ClientPanel ) ClientChat:SetPos( 10, 25 ) ClientChat:SetSize( 280, 330 ) ClientChat:SetEditable( false ) ClientChat:SetEnterAllowed( false ) ClientChat:SetMultiline( true ) ClientEnter = vgui.Create( "DTextEntry", ClientPanel ) ClientEnter:SetPos( 10, 365 ) ClientEnter:SetSize( 280, 25 ) ClientEnter:SetEnterAllowed( true ) ClientEnter:SetEditable( true ) ClientEnter:SetMultiline( false ) ClientEnter.OnEnter = function() ClientChat:SetValue( ClientChat:GetValue() .. LocalPlayer():GetName().. ": " .. ClientEnter:GetValue() .. "\n" ) ClientEnter:SetValue( "" ) end ClientCheck = vgui.Create( "DCheckBoxLabel", ClientPanel ) ClientCheck:SetPos( 250, 365 ) ClientCheck:SetText( "Admin Visible?" ) ClientCheck:SetConVar( "clientreport_visible" ) ClientCheck:SetValue( 0 ) ClientCheck:SizeToContents() end [/lua] Then for the Admins: [lua] function AdminReports() AdminPanel = vgui.Create( "DFrame" ) AdminPanel:SetSize( 300, 400 ) AdminPanel:SetPos( (ScrW()/2) - 150, (ScrH()/2) - 200 ) AdminPanel:ShowCloseButton( true ) AdminPanel:SetTitle( "Admin -> Client Report" ) AdminPanel:SetDraggable( true ) AdminPanel:SetVisible( false ) PropertySheet = vgui.Create( "DPropertySheet", AdminPanel ) PropertySheet:SetPos( 5, 20 ) PropertySheet:SetSize( 290, 395 ) for k, v in pairs (player.GetAll()) do if ConVarExists( "clientreport_visible" ) and ClReportVis:GetInt() == 1 then PropertySheet:AddSheet( v:Name(), ,"gui/silkicons/group", false, false, "Admin Report with: "..v:Name() ) end end end [/lua]
Sorry, you need to Log In to post a reply to this thread.