Ejemplo n.º 1
0
        private bool CanUpdateSign(BasePlayer player, Signage sign)
        {
            if (SignBanInfo.IsSignBanned(player.IPlayer))
            {
                SendChatMessage(player.IPlayer, Lang("Player Try Update", player.UserIDString));
                return(false);
            }

            if (ZoneManager != null && ZMNoSignUpdates(player) == true)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 2
0
        private object OnPlayerCommand(ConsoleSystem.Arg arg)
        {
            if (arg.Connection == null)
            {
                return(false);
            }
            if (SignArtist == null)
            {
                return(null);
            }

            var command = arg.cmd.FullName;
            var args    = arg.GetString(0);
            var player  = arg.Connection.player as BasePlayer;

            if (args.StartsWith("/sil") && SignBanInfo.IsSignBanned(player.IPlayer))
            {
                SendChatMessage(player.IPlayer, Lang("Player Try Update", player.UserIDString));
                return(false);
            }
            return(null);
        }
Ejemplo n.º 3
0
        private void SignCommand(IPlayer player, string command, string[] args)
        {
            if (!CanBanSign(player) && !player.IsServer)
            {
                SendChatMessage(player, Lang("No Permission", player.Id, command));
                return;
            }

            if (args.Length == 0)
            {
                SendChatMessage(player, Lang("Default Message", player.Id));
                return;
            }

            var CommandArg  = args[0].ToLower();
            var CommandInfo = $"{command} {args[0]}";
            var CaseArgs    = (new List <object>
            {
                "ban", "unban"
            });

            if (!CaseArgs.Contains(CommandArg))
            {
                SendChatMessage(player, Lang("Invalid Parameter", player.Id, CommandInfo));
                return;
            }

            switch (CommandArg)
            {
                #region Ban
            case "ban":

                if (args.Length == 1)
                {
                    SendChatMessage(player, Lang("Invalid Syntax Ban", player.Id));
                    return;
                }

                IPlayer Btarget;
                Btarget = GetPlayer(args[1], player);

                if (Btarget == null)
                {
                    return;
                }

                if (SignBanInfo.IsSignBanned(Btarget))
                {
                    SendChatMessage(player, Lang("Player Already Banned", player.Id, Btarget.Name));
                    return;
                }

                SendChatMessage(player, Lang("Player Banning User", player.Id, Btarget.Name));
                SendChatMessage(Btarget, Lang("Target Banned", Btarget.Id));
                bannedply[Btarget.Id] = new SignBanInfo();
                SaveData(bannedply);

                return;

                #endregion Ban

                #region Unban
            case "unban":

                if (args.Length == 1)
                {
                    SendChatMessage(player, Lang("Invalid Syntax Ban", player.Id));
                    return;
                }

                IPlayer Utarget;
                Utarget = GetPlayer(args[1], player);

                if (Utarget == null)
                {
                    return;
                }

                if (!SignBanInfo.IsSignBanned(Utarget))
                {
                    SendChatMessage(player, Lang("Target Not Banned", player.Id, Utarget.Name));
                    return;
                }

                SendChatMessage(player, Lang("Player Unbanning User", player.Id, Utarget.Name));
                SendChatMessage(Utarget, Lang("Target Unbanned", Utarget.Id));
                bannedply.Remove(Utarget.Id);
                SaveData(bannedply);

                return;

                #endregion Unban
            }
        }