コード例 #1
0
        public void windowContent(int id)
        {
            GUILayout.Label("Welcome: " + ControlConnector.getLocalPlayer().name);

            GUILayout.Label("Current Players: " + Provider.clients.Count.ToString() + "/" + Provider.maxPlayers);

            GUILayout.Label("Key bindings:");
            GUILayout.Label("F1 = This menu.");
            GUILayout.Label("F2 = Player Menu");
            GUILayout.Label("F3 = Server Settings Menu");
            GUILayout.Label("F4 = Core Admin Menu (SuperAdmin and above)");

            GUI.DragWindow();
        }
コード例 #2
0
        public void windowContent(int ID)
        {
            if (ControlConnector.getLocalPlayer().channel.owner.isAdmin)
            {
                var Shutdown_style = new GUIStyle(GUI.skin.button);
                Shutdown_style.normal.textColor = Color.red;
                Shutdown_style.stretchWidth     = true;
                Shutdown_style.fontSize         = 20;



                GUILayout.Label("Other Core Admins online right now: ");

                foreach (SteamPlayer p in Provider.clients)
                {
                    if (p.player.channel.owner.isAdmin)
                    {
                        GUILayout.Label("Admin: " + p.player.name);
                    }
                }

                if (GUILayout.Button("Rocket Reload"))
                {
                    ChatManager.sendChat(EChatMode.GROUP, "/rocket reload");
                }
                if (GUILayout.Button("Permissions Reload"))
                {
                    ChatManager.sendChat(EChatMode.GROUP, "/p reload");
                }
                if (GUILayout.Button("Shutdown", Shutdown_style))
                {
                    ChatManager.sendChat(EChatMode.GROUP, "/save");
                    ChatManager.sendChat(EChatMode.GROUP, "/shutdown");
                }
            }
            else
            {
                var NoAdmin_style = new GUIStyle(GUI.skin.label);
                NoAdmin_style.normal.textColor = Color.red;
                NoAdmin_style.fontSize         = 25;

                GUILayout.Label("You are not a Core Admin, this feature is for SuperAdmin and above.", NoAdmin_style);
            }

            GUI.DragWindow();
        }