コード例 #1
0
        public void Execute(IRocketPlayer caller, string[] command)
        {
            if (command.Count() == 0)
            {
                UnturnedPlayer pCaller = (UnturnedPlayer)caller;

                Explode(pCaller.Position);

                UnturnedChat.Say(caller, "You were exploded.", Color.green);
                return;
            }

            if (command.Count() == 1)
            {
                UnturnedPlayer player = DatasTools.findPlayer(caller, command[0]);

                if (player != null)
                {
                    Explode(player.Position);
                    UnturnedChat.Say(caller, "You exploded " + player.CharacterName + ".");
                    UnturnedChat.Say(player, "You were exploded.");
                    return;
                }
            }
        }
コード例 #2
0
        public void Execute(IRocketPlayer caller, string[] command)
        {
            if (command.Count() == 1)
            {
                UnturnedPlayer player = DatasTools.findPlayer(caller, command[0]);

                P2PSessionState_t sessionState;
                SteamGameServerNetworking.GetP2PSessionState(player.CSteamID, out sessionState);

                string playerSteamID = player.CSteamID.ToString();
                string playerIP      = Parser.getIPFromUInt32(sessionState.m_nRemoteIP);

                UnturnedChat.Say(caller, "Player: " + player.CharacterName + " Steam ID: " + playerSteamID + " IP: " + playerIP);
                return;
            }
            else
            {
                UnturnedChat.Say(caller, "Ugh... Used that wrong... Syntax: /investigate (player)", Color.red);
                return;
            }
        }
コード例 #3
0
        private void OnPlayerConnected(UnturnedPlayer player)
        {
            //Add to group
            for (int x = 0; x < DatasEssentialsManager.Instance.Configuration.Instance.permissionsAddOnConnect.Count(); x++)
            {
                Rocket.Core.R.Permissions.AddPlayerToGroup(DatasEssentialsManager.Instance.Configuration.Instance.permissionsAddOnConnect[x], player);
            }

            //Remove to group
            for (int x = 0; x < DatasEssentialsManager.Instance.Configuration.Instance.permissionsRemoveOnConnect.Count(); x++)
            {
                Rocket.Core.R.Permissions.RemovePlayerFromGroup(DatasEssentialsManager.Instance.Configuration.Instance.permissionsRemoveOnConnect[x], player);
            }

            //Admin section
            if (player.IsAdmin)
            {
                player.GodMode    = true;
                player.VanishMode = true;
                DatasTools.maxSkills(player, true);

                if (DatasEssentialsManager.Instance.Configuration.Instance.modKickBanList.Count != 0)
                {
                    UnturnedChat.Say(player, "A mod had muted/kicked/banned a player while away, check with /modreport.", Color.cyan);
                }
            }

            #region Joined Notifcation
            if (DatasEssentialsManager.Instance.Configuration.Instance.announceAdmin && player.IsAdmin)
            {
                UnturnedChat.Say(player.DisplayName + " has joined the server!", Color.cyan);
                return;
            }

            if (!player.IsAdmin)
            {
                UnturnedChat.Say(player.DisplayName + " has joined the server!", Color.green);
            }
            #endregion
        }
コード例 #4
0
        public void Execute(IRocketPlayer caller, string[] command)
        {
            if (command.Count() == 2)
            {
                player = DatasTools.findPlayer(caller, command[0]);

                var pSkills = player.Player.skills;

                Boolean overpower = false;
                if (command[1].Equals("true", StringComparison.InvariantCultureIgnoreCase))
                {
                    overpower = true;
                }
                else if (command[1].Equals("false", StringComparison.InvariantCultureIgnoreCase))
                {
                    overpower = false;
                }
                else
                {
                    UnturnedChat.Say(caller, "You used that wrong. Syntax: /maxskils (player name) (Persistent/OP)", Color.red);
                    return;
                }

                foreach (var skill in pSkills.skills.SelectMany(skArr => skArr))
                {
                    skill.level = overpower ? byte.MaxValue : skill.max;
                }
                pSkills.askSkills(player.CSteamID);

                UnturnedChat.Say(caller, "Max skills given to " + player.CharacterName + ".", Color.cyan);
                UnturnedChat.Say(player, "You've received max skills.", Color.cyan);
                return;
            }
            else
            {
                UnturnedChat.Say(caller, "You used that wrong. Syntax: /maxskils (player name) (Persistent/OP)", Color.red);
                return;
            }
        }