Hi, Let's get the important thing out of the way, Sorry for not putting a bounty on this, just joined . anyways, I've recently taken up the task of creating a custom chat tags addon for my server. I've got everything down design wise, and I need help making it work. I've got all the things necessary for this to work, the drop-down, the text box, etc. but right now nothing does nothing. I have no clue how to make it so that when I select a player, enter a tag in the text entry box, and click submit, it would add that tag to the front of said person's name when they type in chat, and obviously I also need it to save :P it would be useless otherwise. When it comes to things like this, I'm not that smart. Thank you for looking at this thread, and again I'm so so terribly sorry that there is no bounty. here's my current code for 'ya
include("shared.lua")
net.Receive("tagscmd", function(ply)
if( !frame ) then
local frame = vgui.Create("DFrame")
frame:SetSize(400,200)
frame:SetPos(ScrW()/2-450,ScrH()/2-300)
frame:SetTitle("[DEV] Chat Tags")
frame:SetVisible(true)
frame:MakePopup()
frame:SetDeleteOnClose(true)
frame.Paint = function(self,w,h)
draw.RoundedBox(0,0,0,w,h,Color(55,55,55,250))
end
local DComboBox = vgui.Create( "DComboBox", frame )
DComboBox:SetPos( 40, 60 )
DComboBox:SetSize( 100, 20 )
DComboBox:SetValue( "Select Player" )
for _,v in ipairs(player.GetAll()) do DComboBox:AddChoice(v:Name()) end
DComboBox.OnSelect = function( panel, index, value )
print( value .." was selected!" )
end
local TextEntry = vgui.Create( "DTextEntry", frame ) -- create the form as a child of frame
TextEntry:SetPos( 240, 60 )
TextEntry:SetSize( 100, 20 )
TextEntry:SetText( "Tag to give" )
TextEntry.OnEnter = function( self )
chat.AddText( self:GetValue() ) -- print the form's text as server text
end
local InfoText = vgui.Create("DLabel", frame)
InfoText:SetPos(10, 180)
InfoText:SetSize(1000,15)
InfoText:SetText("Made by InVaLiD, use only for ThunderGaming")
local OKButton = vgui.Create( "DButton", frame )
OKButton:SetPos(320,170)
OKButton:SetSize(75, 25)
OKButton:SetText("Submit")
end
end)
Still on the first page Need help with custom chat tags addon
"I've got all the things necessary for this to work" - they are not. You ask us to write necessary things for you.
Network library, SQL library (or Player/SetPData, Player/GetPData), GM/OnPlayerChat (tip: first example)
No, They don't <3
Anyway, though there were quite rude comments in that reply (You hurt my feel bads D:) You did help me a lot, so I thank you, again, I'm quite new to this, don't know much. Thank you for not giving me the answer outright, I feel that you don't learn anything when ppl just give you the code. Really do appreciate it <3
Sorry, you need to Log In to post a reply to this thread.