I am pretty unfamiliar with writing code but I am a fairly competent individual in the IT community. I have been looking through some of the plugins that include GUI's and figured it wouldn't be to challenging to modify/add to some of them to personalize the plugin to my specific needs. That being said, what tool should I be using to modify these scripts. I usually open json's with notepad to make minor tweaks and ultimately run them through JSON Validator; likewise for the plugin cs and lua files I usually look through details in notepad but never make changes. Is Unity the answer?
Thanks!!!
Adding elements to a GUI?
Discussion in 'Rust Development' started by Absolut, Mar 24, 2016.
-
If your asking about a good program to edit code with, I personally use "Visual Studio Code"
-
In your opinion if I say had the ServerInfo plugin installed and wanted to add (2) custom buttons on the GUI to execute simple commands such as "usergroup add x y",
"usergroup remove x z"
but only if user is not in oxide.group y or z
Shouldn't that be pretty straightforward? -
Are you trying to make a team selection for when a player joins?
-
Yes

I have been using a manual process that involes NPCs, zones, warps, and Zone command. Although it works it is a bit clunky and doesn't recoginze that a player has already joined a side.
A simple button system would prevent switching of sides without admin help and also allow random spawns on the beach to remain intact. -
For selecting teams you can use a Dictionary for storing teams(Per player)
[DOUBLEPOST=1458873183][/DOUBLEPOST]Now that isn't the best way to do it, but personally thats just a quick way. You could use multiple other ways to do this(lists, etc)Code:class StoredData { Dictionary<ulong, UserInfo> Users = new Dictionary<ulong, UserInfo>(); public StoredData() { } }class UserInfo { string Name; float userID; bool IsTeam1; bool IsTeam2; public UserInfo() { } } -
Based on oxide.group we are already restricting friendly Fire and friendly building destruction so I don't really need to create a new structure. I am fairly certain the other scripts are querying the oxide.group already to see if user is a member of or not and applying conditions accordingly. Therefore, I just need 2 buttons that add a user to said oxide.group and as a fail safe remove the user from the other group (to prevent someone from being in both).
An interactive button that executes the commands I posted would work like a charm. maybe a prerequisite check of if user is in one of the two oxide.groups make the button hidden or disabled?
I just don't understand the code structure for creating Gui elements?
I don't know maybe I am way off but I do these types of things in infopath, Sql, and SharePoint workflows but the difference is the GUI elements are integrated? -
You would be better off moving away from the permission based system you are currently using. I have written pretty much exactly what you are going to want to do for TeamBattlefield, add me on steam and I'll walk you through it
-
Will do, I'm on mobile and will be home later. Thanks!
