• [HELP] Derma to change variables
    4 replies, posted
Hello everyone, I'm trying to learn how to program in Garrys Mod. My initial project is to make a notification system. What I would like to do is to edit the "surface.DrawRect" and "draw.DrawText" from a derma menu and apply it to all clients. The first idea I had was that by "concommand.Add" pass all the arguments and apply, but it does not seem viable for how long the command would be. The second idea I had was that through "net.Send" and derma send all the variables of the client to the server, and that the server sends it to the client and it processes it. And the third idea I have (which I'm trying to implement) is to directly edit the variable, and then send a "net.Send" to all the clients to load the function. But I do not know if this will work for all clients. The downside of this is that I have to press enter every time I edit something, and I would like it to be in real time. local MenuTitulo = vgui.Create ("DTextEntry") MenuTitle: SetText (Menu.Title.Text) MenuTitulo.OnEnter = function (self) Menu.Title.Text = self: GetValue () end Otherwise it does not work for example to process variables like the position "SrcW () * 0.02" if I edit from the derma 0.02 the variable is not updated. I'm a bit lost since I do not know how to do it, how to send all the data and that it applies to all the clients in real time and can edit everything from the derma. I would like you to do something like this (3 seconds): https://youtu.be/uXnOXBIqsDk?t=3
The menu in 3rd second is called Editable Entities
Thanks for answering. The "Editable Entities" menu does not know if it can be shown in a derma?
It is a derma. If you want to edit entity by derma use Editable Entities. Otherwise make net with feedback to clients. One client changes something, send to server then server duplicate changes for other clients
OK. And how can I collect all the data set in the derma menu when I click on the 'save' button that will then send all the data to the server?
Sorry, you need to Log In to post a reply to this thread.