• Make an admin menu
    17 replies, posted
So i made a rules menu when you do /rules in the chat the DFrame open with each rules but i want to do another panel with the command /adminrules and there are textbox with the possibility to change the rules from the panel /rules For information: For the rules i made a global file like RULE1_NAME if it can help you
DTextEntry and DRextEntry:OnEnter() RULE1 = DTextEntry:GetValue() Basically like that
Can you give me an example pls because i don't really understand I want a textbox like this one https://steamuserimages-a.akamaihd.net/ugc/1047378331347012056/C048C1A8291B92530FA8F8FB68A0D0A48430744C/ And when i write someting like (Don't kill) the first rule that the global file is RULE1_NAME the first rule change for Don't kill
DTextEntry, DButton
DTextEntry, DButton, net.Start, net.SendToServer, file.Write, File/Read You'll need to do networking if you want to do anything on the clientside. File.read/write are for adding new rules. You network it the server which puts it into a rules.txt file
-------------------CONFIG------------------- local PANEL_TITLE = "Rules" -- DON'T TOUCH THE \n RULES1_NAME = "Rule #1\n" RULES2_NAME = "Rule #2\n" RULES3_NAME = "Rule #3\n" RULES4_NAME = "Rule #4\n" RULES5_NAME = "Rule #5\n" RULES6_NAME = "Rule #6\n" RULES7_NAME = "Rule #7\n" RULES8_NAME = "Rule #8\n" RULES9_NAME = "Rule #9\n" RULES10_NAME = "Rule #10" --------------------------------------------- surface.CreateFont( "titlefont", {  font = "Impact",  size = 25,  weight = 500,  blursize = 0,  scanlines = 0,  antialias = true } ) net.Receive("OpenRuleMenu", function() local frame = vgui.Create("DFrame") frame:SetTitle(PANEL_TITLE) frame:Center(true) frame:SetVisible(true) frame:SetSize(300, 300) frame:MakePopup() frame:ShowCloseButton(true) local richtext = vgui.Create( "RichText", frame ) richtext:Dock( FILL ) richtext:InsertColorChange( 192, 192, 192, 255 ) richtext:AppendText(RULES1_NAME) richtext:AppendText(RULES2_NAME) richtext:AppendText(RULES3_NAME) richtext:AppendText(RULES4_NAME) richtext:AppendText(RULES5_NAME) richtext:AppendText(RULES6_NAME) richtext:AppendText(RULES7_NAME) richtext:AppendText(RULES8_NAME) richtext:AppendText(RULES9_NAME) richtext:AppendText(RULES10_NAME) richtext.Paint = function()     richtext.m_FontName = "titlefont"     richtext:SetFontInternal( "titlefont" )     richtext:SetBGColor(Color(0,0,0,0))     richtext.Paint = nil end end) net.Receive("OpenAdminRuleMenu", function() local frameadmin = vgui.Create( "DFrame" ) frameadmin:SetSize( 400, 200 ) frameadmin:Center() frameadmin:MakePopup() local TextEntry = vgui.Create( "DTextEntry", frameadmin ) -- create the form as a child of frame TextEntry:SetPos( 25, 50 ) TextEntry:SetSize( 75, 85 ) TextEntry:SetText( RULES1_NAME ) TextEntry:OnEnter(RULES1_NAME) TextEntry:GetValue() end) Nothing work pls help me
Do you read on wiki about TextEntry:OnEnter(RULES1_NAME) TextEntry:GetValue() ?
Yes i really don't understand im unable to understand this web site idk why
Ok. I will try to explain you them. Let's variable "myDerma" will be a derma object in my post 1 . Derma function types Derma objects has two types of function - Call To, Call From Call To: myDerma:SetPos(30,40) // We sad derma to move itself to positions x:30 y:40 myDerma:Close() // We sad derma to Close itself (Works only with DFrame and their inherits panels. For other use myDerma:Remove() Call From: myDerma.DoClick = function() print("Some functions in derma called this function that we had set" end myDerma.OnChange = function() myDerma:Remove() end We can call Call From functions too, but they are they for using outside of derma, because they are some internal functions that need to work inside, some of them provides Call From function.
-------------------CONFIG------------------- local PANEL_TITLE = "Rules" -- DON'T TOUCH THE \n RULES1_NAME = "Rule #1\n" RULES2_NAME = "Rule #2\n" RULES3_NAME = "Rule #3\n" RULES4_NAME = "Rule #4\n" RULES5_NAME = "Rule #5\n" RULES6_NAME = "Rule #6\n" RULES7_NAME = "Rule #7\n" RULES8_NAME = "Rule #8\n" RULES9_NAME = "Rule #9\n" RULES10_NAME = "Rule #10" --------------------------------------------- surface.CreateFont( "titlefont", { font = "Impact", size = 25, weight = 500, blursize = 0, scanlines = 0, antialias = true } ) net.Receive("OpenRuleMenu", function() local frame = vgui.Create("DFrame") frame:SetTitle(PANEL_TITLE) frame:Center(true) frame:SetVisible(true) frame:SetSize(300, 300) frame:MakePopup() frame:ShowCloseButton(true) local richtext = vgui.Create( "RichText", frame ) richtext:Dock( FILL ) richtext:InsertColorChange( 192, 192, 192, 255 ) richtext:AppendText(RULES1_NAME) richtext:AppendText(RULES2_NAME) richtext:AppendText(RULES3_NAME) richtext:AppendText(RULES4_NAME) richtext:AppendText(RULES5_NAME) richtext:AppendText(RULES6_NAME) richtext:AppendText(RULES7_NAME) richtext:AppendText(RULES8_NAME) richtext:AppendText(RULES9_NAME) richtext:AppendText(RULES10_NAME) richtext.Paint = function() richtext.m_FontName = "titlefont" richtext:SetFontInternal( "titlefont" ) richtext:SetBGColor(Color(0,0,0,0)) richtext.Paint = nil end end) net.Receive("OpenAdminRuleMenu", function() local frameadmin = vgui.Create( "DFrame" ) frameadmin:SetSize( 400, 200 ) frameadmin:Center() frameadmin:MakePopup() local TextEntry = vgui.Create( "DTextEntry", frameadmin ) -- create the form as a child of frame TextEntry:SetPos( 25, 50 ) TextEntry:SetSize( 75, 85 ) TextEntry:SetText( RULES1_NAME ) function TextEntry:OnChange(self) ... end So if i do this i can change the richtext:AppendText(RULES1_NAME) with my frameadmin ?
You can change, if you .net it to server, and server broadcasts it to RULES1_NAME I offer you to use button to send text from TextEntry
Fuck off i put this god damn shit but it don'T change nothing when i put something in the text box the RULE1_NAME on the first panel don't change
People are trying to help you and you just tell them to fuck off and insult their code? Learn to do it yourself if you're gonna be so damn hostile.
But it doesn't work
It doesn't work, because you don't know how to code.
I hope you don't intend to sell this garbage.
Here is some resources. How functions work on Lua Wiki How functions work on Official Lua Site Whole list of Resources of Lua Wiki All funciton tutorials
No im not gonna use it it's for a friend
Sorry, you need to Log In to post a reply to this thread.