Пример #1
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                arg1 = player.player.username;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            ReadFile.Run(GodListFile);
            var msg = $"<color={infoColor}>Godmode</color> <color={argColor}>{{0}}</color> <color={infoColor}>for</color> <color={argColor}>'{arg1}'</color><color={infoColor}>.</color>";

            if (GodListPlayers.Contains(currPlayer.username))
            {
                RemoveStringFromFile.Run(GodListFile, currPlayer.username);
                ReadFile.Run(GodListFile);
                player.SendChatMessage(string.Format(msg, "disabled"));
                return;
            }
            File.AppendAllText(GodListFile, currPlayer.username + Environment.NewLine);
            GodListPlayers.Add(currPlayer.username);
            player.SendChatMessage(string.Format(msg, "enabled"));
        }
Пример #2
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            ReadFile.Run(MuteListFile);
            if (!MutePlayers.Contains(currPlayer.username))
            {
                MutePlayers.Add(currPlayer.username);
                File.AppendAllText(MuteListFile, currPlayer.username + Environment.NewLine);
                player.SendChatMessage($"<color={infoColor}>Muted </color><color={argColor}>{currPlayer.username}</color><color={infoColor}>.</color>");
                return;
            }
            RemoveStringFromFile.Run(MuteListFile, currPlayer.username);
            ReadFile.Run(MuteListFile);
            player.SendChatMessage($"<color={infoColor}>Unmuted </color><color={argColor}>{currPlayer.username}</color><color={infoColor}>.</color>");
        }
Пример #3
0
 public static void Run(SvPlayer player, string message)
 {
     string arg1 = GetArgument.Run(1, false, true, message);
     string arg2 = message.Split(' ').Last().Trim();
     string correctSyntax = $"<color={argColor}>{GetArgument.Run(0, false, false, message)}</color> <color={errorColor}>[Player] [Amount]</color> <color={warningColor}>(Incorrect or missing argument(s).)</color>";
     if (string.IsNullOrEmpty(arg1) || string.IsNullOrEmpty(arg2))
     {
         player.SendChatMessage(correctSyntax);
         return;
     }
     int lastIndex = arg1.LastIndexOf(" ", StringComparison.CurrentCulture);
     if (lastIndex != -1)
         arg1 = arg1.Remove(lastIndex).Trim();
     bool parsedSuccessfully = int.TryParse(arg2, out var arg2int);
     if (!parsedSuccessfully)
     {
         player.SendChatMessage(correctSyntax);
         return;
     }
     var currPlayer = GetShByStr.Run(arg1);
     if (currPlayer == null)
     {
         player.SendChatMessage(NotFoundOnline);
         return;
     }
     currPlayer.TransferMoney(DeltaInv.AddToMe, arg2int, true);
     player.SendChatMessage($"<color={infoColor}>Successfully gave</color> <color={argColor}>{currPlayer.username} {arg2int}</color><color={infoColor}>$</color>");
     currPlayer.svPlayer.SendChatMessage($"<color={argColor}>{player.player.username}</color><color={infoColor}> gave you </color><color={argColor}>{arg2int}</color><color={infoColor}>$!</color>");
 }
Пример #4
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            currPlayer.svPlayer.Restrain(currPlayer.manager.handcuffed);
            var shRetained = currPlayer.curEquipable as ShRestrained;

            currPlayer.svPlayer.SvSetEquipable(shRetained.otherRestrained.index);
            if (!currPlayer.svPlayer.serverside)
            {
                currPlayer.svPlayer.SendChatMessage("You've been restrained");
            }
            player.SendChatMessage($"<color={infoColor}>Restrained</color> <color={argColor}>{currPlayer.username}</color><color={infoColor}>.</color>");
        }
Пример #5
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            arg1 = arg1.Remove(arg1.LastIndexOf(" ", StringComparison.CurrentCulture)).Trim();
            var shPlayer = GetShByStr.Run(arg1);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            if (!float.TryParse(message.Split(' ').Last().Trim(), out float time))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            if (!SendToJail.Run(shPlayer, time))
            {
                player.SendChatMessage($"<color={errorColor}>Cannot send</color> <color={argColor}>{shPlayer.username}</color> <color={errorColor}>To jail.</color>");
                return;
            }
            shPlayer.svPlayer.SendChatMessage($"<color={argColor}>{player.player.username}</color> <color={infoColor}>sent you to jail.</color>");
            player.SendChatMessage($"<color={infoColor}>Sent</color> <color={argColor}>{shPlayer.username}</color> <color={infoColor}>To jail.</color>");
        }
Пример #6
0
        public static void Run(SvPlayer player, string message)
        {
            var arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.Send(SvSendType.Self, Channel.Reliable, ClPacket.GameMessage, ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            string[] contentarray =
            {
                "Username:              "******"",
                "",
                "Job:                         " + Jobs[currPlayer.job.jobIndex],
                "Health:                    " + Math.Floor(currPlayer.health),
                "OwnsApartment:   " + (bool)currPlayer.ownedApartment,
                "Position:                 " + currPlayer.GetPosition().ToString(),
                "WantedLevel:         " + currPlayer.wantedLevel,
                "IsAdmin:                 " + currPlayer.admin,
                "BankBalance:         " + currPlayer.svPlayer.bankBalance,
                "ChatEnabled:         " + PlayerList[currPlayer.ID].ChatEnabled,
                "IP:                            " + currPlayer.svPlayer.connection.IP
            };
            var content = string.Join("\r\n", contentarray);

            player.Send(SvSendType.Self, Channel.Reliable, ClPacket.ServerInfo, content);
        }
Пример #7
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var shPlayer = GetShByStr.Run(arg1);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            if (shPlayer == player.player)
            {
                player.SendChatMessage($"<color={errorColor}>You cannot teleport to yourself.</color>");
                return;
            }
            PlayerList[shPlayer.ID].TpaUser = player.player;
            player.SendChatMessage($"<color={infoColor}>Sent a TPA request to</color> <color={argColor}>{shPlayer.username}</color><color={infoColor}>.</color>");
            shPlayer.svPlayer.SendChatMessage($"<color={argColor}>{player.player.username}</color> <color={infoColor}>sent you a tpa request. Type</color> <color={argColor}>{CmdCommandCharacter}{CmdTpaaccept}</color> <color={infoColor}>to accept it.</color>");
        }
Пример #8
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var shPlayer = GetShByStr.Run(arg1);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            var tempList = new List <InventoryItem>();

            foreach (var item in shPlayer.myItems.Values)
            {
                tempList.Add(item);
            }
            for (int i = 0; i < tempList.Count; i++)
            {
                shPlayer.TransferItem(DeltaInv.RemoveFromMe, tempList[i].item.index, shPlayer.MyItemCount(tempList[i].item.index), true);
            }
            player.SendChatMessage($"<color={infoColor}>You cleared the inventory of</color> <color={argColor}>{shPlayer.username}</color><color={infoColor}>.</color>");
            shPlayer.svPlayer.SendChatMessage($"<color={warningColor}>Your inventory has been cleared by</color> <color={argColor}>{player.playerData.username}</color><color={warningColor}>.</color>");
        }
Пример #9
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            // To be improved
            currPlayer.svPlayer.SvSetWearable(-1626497894);  //NullArmor
            currPlayer.svPlayer.SvSetWearable(673780802);    //NullBack
            currPlayer.svPlayer.SvSetWearable(-1638932793);  //NullBody
            currPlayer.svPlayer.SvSetWearable(1089711634);   //NullFace
            currPlayer.svPlayer.SvSetWearable(2064679354);   //NullFeet
            currPlayer.svPlayer.SvSetWearable(1174688158);   //NullHands
            currPlayer.svPlayer.SvSetWearable(-501996567);   //NullHead
            currPlayer.svPlayer.SvSetWearable(-1191209217);  //NullLegs
            foreach (var item in currPlayer.myItems.Values.ToList())
            {
                if (item.item.GetType() == typeof(ShWearable))
                {
                    currPlayer.TransferItem(DeltaInv.RemoveFromMe, item.item.index, currPlayer.MyItemCount(item.item.index), true);
                }
            }
            currPlayer.svPlayer.SendChatMessage($"<color={argColor}>{player.playerData.username}</color> <color={warningColor}>Removed your clothes.</color>");
            player.SendChatMessage($"<color={infoColor}>Removed </color><color={argColor}>{currPlayer.username}</color><color={infoColor}>'s clothes.</color>");
        }
Пример #10
0
        public static void Run(SvPlayer player, string message)
        {
            string correctSyntax = $"<color={argColor}>{GetArgument.Run(0, false, false, message)}</color> <color={errorColor}>[Player] [Amount]</color> <color={warningColor}>(Incorrect or missing argument(s).)</color>";
            string arg1          = GetArgument.Run(1, false, true, message);
            string arg2          = message.Split(' ').Last().Trim();

            if (string.IsNullOrEmpty(GetArgument.Run(1, false, false, message)) || string.IsNullOrEmpty(arg2))
            {
                player.SendChatMessage(correctSyntax);
                return;
            }
            int lastIndex = arg1.LastIndexOf(" ", StringComparison.CurrentCulture);

            if (lastIndex != -1)
            {
                arg1 = arg1.Remove(lastIndex).Trim();
            }
            var parsedSuccessfully = int.TryParse(arg2, out int arg2Int);

            if (!parsedSuccessfully)
            {
                player.SendChatMessage(correctSyntax);
                return;
            }
            if (arg2Int <= 0)
            {
                player.SendChatMessage($"<color={errorColor}>Cannot transfer 0$ or less.</color>");
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }

            if (player.player.MyMoneyCount() < arg2Int)
            {
                player.SendChatMessage($"<color={errorColor}>Cannot transfer money, do you have</color> <color={argColor}>{arg2Int}</color><color={errorColor}>$ in your inventory?</color>");
                return;
            }
            player.player.TransferMoney(DeltaInv.RemoveFromMe, arg2Int, true);
            currPlayer.TransferMoney(DeltaInv.AddToMe, arg2Int, true);
            player.SendChatMessage($"<color={infoColor}>Successfully transfered</color> <color={argColor}>{arg2Int}</color><color={infoColor}>$ to </color><color={argColor}>{currPlayer.username}</color><color={infoColor}>!</color>");
            currPlayer.svPlayer.SendChatMessage($"<color={argColor}>{player.player.username}</color><color={infoColor}> gave you </color><color={argColor}>{arg2Int}</color><color={infoColor}>$!</color>");
        }
Пример #11
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1       = GetArgument.Run(1, false, false, message);
            string arg2       = GetArgument.Run(2, false, true, message);
            byte   arg1Parsed = 10;
            string msg        = $"<color={infoColor}>Set </color><color={argColor}>{{0}}</color><color={infoColor}>'s Job to</color> <color={argColor}>{{1}}</color><color={infoColor}>.</color>";

            if (string.IsNullOrEmpty(arg2))
            {
                arg2 = player.player.username;
            }
            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(NotValidArg);
                return;
            }
            bool parsedCorrectly = true;

            if (Jobs.Contains(arg1))
            {
                arg1Parsed = Convert.ToByte((Array.IndexOf(Jobs, arg1)));
            }
            else
            {
                parsedCorrectly = byte.TryParse(arg1, out arg1Parsed);
            }
            if (!parsedCorrectly)
            {
                player.SendChatMessage(NotValidArg);
                return;
            }
            if (arg1Parsed > player.player.jobs.Length || arg1Parsed < 0)
            {
                player.SendChatMessage($"<color={errorColor}>Error: The value must be between 0 and {player.player.jobs.Length}.</color>");
                return;
            }
            var currPlayer = GetShByStr.Run(arg2);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            player.SendChatMessage(string.Format(msg, currPlayer.username, Jobs[arg1Parsed]));
            currPlayer.svPlayer.SvSetJob(player.player.jobs[arg1Parsed], true, false);
        }
Пример #12
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.Send(SvSendType.Self, Channel.Reliable, ClPacket.GameMessage, $"<color={errorColor}>Missing argument! Correct syntax:</color> <color={warningColor}>{GetArgument.Run(0, false, false, message)} [player]</color>");
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            if (currPlayer == player.player)
            {
                player.Send(SvSendType.Self, Channel.Reliable, ClPacket.GameMessage, $"<color={errorColor}>Hey! You cannot report yourself, dummy.</color>");
                return;
            }
            if (player.player.admin)
            {
                player.Send(SvSendType.Self, Channel.Reliable, ClPacket.GameMessage, $"<color={errorColor}>Hey! You cannot report as admin.</color>");
                return;
            }
            if (currPlayer.admin)
            {
                player.Send(SvSendType.Self, Channel.Reliable, ClPacket.GameMessage, $"<color={errorColor}>Hey! You cannot report an admin.</color>");
                return;
            }
            var builder = new StringBuilder();

            builder.Append("<color=#00ffffff>Reporting</color> <color=#ea8220>" + arg1 + "</color>\n<color=#00ffffff>Reason:</color>\n\n");
            for (int i = 0; i < ReportReasons.Length; i++)
            {
                if (string.IsNullOrWhiteSpace(ReportReasons[i]))
                {
                    continue;
                }
                builder.Append("<color=#00ffffff>F" + (i + 2) + ":</color> " + ReportReasons[i] + "\n");
            }
            player.Send(SvSendType.Self, Channel.Reliable, ClPacket.ShowFunctionMenu, builder + "\n<color=#00ffffff>Press</color> <color=#ea8220>F11</color> <color=#00ffffff>To close this (G)UI</color>");
            PlayerList[player.player.ID].LastMenu       = CurrentMenu.Report;
            PlayerList[player.player.ID].ReportedPlayer = currPlayer;
        }
Пример #13
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                arg1 = player.player.username;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            currPlayer.RestoreStats();
            player.SendChatMessage($"<color={infoColor}>Maxed stats for</color> <color={argColor}>{currPlayer.username}</color><color={infoColor}>.</color>");
        }
Пример #14
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var shPlayer = GetShByStr.Run(arg1);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            player.ResetAndSavePosition(shPlayer.GetPosition(), shPlayer.GetRotation(), shPlayer.GetPlaceIndex());
            player.SendChatMessage($"<color={infoColor}>Teleported to</color> <color={argColor}>{shPlayer.username}</color><color={infoColor}>.</color>");
        }
Пример #15
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var shPlayer = GetShByStr.Run(arg1);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            player.svManager.Kick(shPlayer.svPlayer.connection);
            player.SendChatMessage($"<color={infoColor}>Kicked</color> <color={argColor}>{shPlayer.username}</color><color={infoColor}>.</color>");
        }
Пример #16
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            currPlayer.svPlayer.SvSuicide();
            player.SendChatMessage($"<color={infoColor}>Killed</color> <color={argColor}>{currPlayer.username}</color><color={infoColor}>.</color>");
        }
Пример #17
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                arg1 = player.player.username;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            currPlayer.ClearCrimes();
            currPlayer.svPlayer.Send(SvSendType.Self, Channel.Reliable, ClPacket.ClearCrimes, currPlayer.ID);
            player.SendChatMessage($"<color={infoColor}>Cleared crimes of '{currPlayer.username}'.</color>");
        }
Пример #18
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            currPlayer.svPlayer.SvForce(new Vector3(0f, 6500f, 0f));
            currPlayer.svPlayer.SendChatMessage($"<color={warningColor}>Off you go!</color>");
            player.SendChatMessage($"<color={infoColor}>You've launched </color><color={argColor}>{currPlayer.username}</color><color={infoColor}> into space!</color>");
        }
Пример #19
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, false, message);
            string arg2 = GetArgument.Run(2, false, true, message);

            if (string.IsNullOrEmpty(arg1) || string.IsNullOrEmpty(arg2))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var shPlayer = GetShByStr.Run(arg1, true);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnlineIdOnly);
                return;
            }
            shPlayer.svPlayer.SvGlobalChatMessage(arg2);
            player.SendChatMessage($"<color={infoColor}>You sudo'ed</color> <color={argColor}>{shPlayer.username}</color> <color={infoColor}>to type</color> <color={argColor}>{arg2}</color> <color={infoColor}>in the global chat.</color>");
        }
Пример #20
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, false, message);
            string arg2 = GetArgument.Run(2, false, true, message);

            if (string.IsNullOrEmpty(arg1) || string.IsNullOrEmpty(arg2))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var shPlayer = GetShByStr.Run(arg1, true);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnlineIdOnly);
                return;
            }
            PlayerList[shPlayer.ID].ReplyToUser = player.player;
            player.SendChatMessage($"<color={infoColor}>[PM]</color> <color={argColor}>{shPlayer.username}</color> <color={warningColor}>></color> <color={infoColor}>{arg2}</color>");
            shPlayer.svPlayer.SendChatMessage($"<color={infoColor}>[PM]</color> <color={argColor}>{player.player.username}</color> <color={warningColor}><</color> <color={infoColor}>{arg2}</color>");
        }
Пример #21
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            if (currPlayer == player.player)
            {
                player.SendChatMessage($"<color={errorColor}>You cannot search yourself.</color>");
                return;
            }
            if (currPlayer.IsDead())
            {
                player.SendChatMessage($"<color={errorColor}>You cannot search this player because he or she is dead.</color>");
                return;
            }
            if (currPlayer.otherEntity)
            {
                currPlayer.svPlayer.SvStopInventory(true);
            }
            currPlayer.viewers.Add(player.player);
            player.player.otherEntity = currPlayer;
            player.Send(SvSendType.Self, Channel.Fragmented, ClPacket.Searching, player.player.otherEntity.ID, player.player.otherEntity.SerializeMyItems());
            if (!currPlayer.svPlayer.serverside && currPlayer.viewers.Count == 1)
            {
                currPlayer.svPlayer.Send(SvSendType.Self, Channel.Reliable, ClPacket.ShowSearchedInventory, new object[] { });
            }
            player.SendChatMessage($"<color={infoColor}>Viewing inventory of</color> <color={argColor}>{currPlayer.username}</color>");
            currPlayer.svPlayer.SendChatMessage(AdminSearchingInv);
        }
Пример #22
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            int amount = new System.Random().Next(4, 15);

            currPlayer.svPlayer.Damage(DamageIndex.Null, amount, null, null);
            currPlayer.svPlayer.SvForce(new Vector3(500f, 0f, 500f));
            currPlayer.svPlayer.SendChatMessage($"<color={warningColor}>You got slapped by </color><color={argColor}>{player.player.username}</color><color={warningColor}>! [-{amount} HP]</color>");
            player.SendChatMessage($"<color={infoColor}>You've slapped </color><color={argColor}>{currPlayer.username}</color><color={infoColor}>. [-{amount} HP]</color>");
        }
Пример #23
0
        public static void Run(SvPlayer player, string message)
        {
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var currPlayer = GetShByStr.Run(arg1);

            if (currPlayer == null)
            {
                player.SendChatMessage(NotFoundOnline);
                return;
            }
            if (currPlayer.rank >= 2)
            {
                player.SendChatMessage($"<color={argColor}>{currPlayer.username}</color> <color={errorColor}>Already has the highest rank!</color>");
                return;
            }
            currPlayer.svPlayer.Reward(currPlayer.maxExperience - currPlayer.experience + 1, 0);
            player.SendChatMessage($"<color={infoColor}>Promoted</color> <color={argColor}>{currPlayer.username}</color> <color={infoColor}>to rank</color> <color={argColor}>{currPlayer.rank + 1}</color><color={infoColor}>.</color>");
        }
Пример #24
0
        public static void Run(SvPlayer player, string message)
        {
            var arg1 = GetArgument.Run(1, false, false, message);
            var arg2 = GetArgument.Run(2, false, true, message);

            if (string.IsNullOrEmpty(arg1) || string.IsNullOrEmpty(arg2))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            var shPlayer = GetShByStr.Run(arg1, true);

            if (shPlayer == null)
            {
                player.SendChatMessage(NotFoundOnlineIdOnly);
                return;
            }
            LogMessage.LogOther($"{PlaceholderParser.ParseTimeStamp()} [INFO] {shPlayer.username} Got banned by {player.playerData.username} (Reason: {arg2}");
            player.Send(SvSendType.All, Channel.Unsequenced, ClPacket.GameMessage, $"<color={argColor}>{shPlayer.username}</color> <color={warningColor}>Just got banned by</color> <color={argColor}>{player.playerData.username}</color> <color={warningColor}>(Reason: </color><color={argColor}>{arg2}</color><color={warningColor}>)</color>");
            SendDiscordMessage.BanMessage(shPlayer.username, player.playerData.username, arg2);
            player.SendChatMessage($"<color={infoColor}>Banned</color> <color={argColor}>{shPlayer.username}</color><color={infoColor}>. (Reason: {arg2})</color>");
            player.svManager.AddBanned(shPlayer);
            player.svManager.Disconnect(shPlayer.svPlayer.connection, DisconnectTypes.Banned);
        }
Пример #25
0
        public static void Run(SvPlayer player, string message)
        {
            var    shPlayer = player.player;
            string arg      = GetArgument.Run(1, false, false, message).Trim().ToLower();

            switch (arg)
            {
            case "location":
            case "getlocation":
                player.SendChatMessage("Your location: " + shPlayer.GetPosition());
                break;

            case "getplayerhash":
            case "gethash":
            {
                string arg2 = GetArgument.Run(2, false, true, message);
                if (string.IsNullOrEmpty(arg2))
                {
                    player.SendChatMessage("Invalid arguments. /debug get(player)hash [username]");
                    return;
                }
                player.SendChatMessage("Hash of " + arg2 + " : " + Animator.StringToHash(arg2));
                break;
            }

            case "spaceindex":
            case "getspaceindex":
            {
                string arg2 = GetArgument.Run(2, false, true, message);
                if (string.IsNullOrEmpty(arg2))
                {
                    player.SendChatMessage("Your SpaceIndex: " + shPlayer.GetPlaceIndex());
                    return;
                }
                var argshPlayer = GetShByStr.Run(arg2);
                if (argshPlayer == null)
                {
                    player.SendChatMessage(NotFoundOnline);
                    return;
                }
                player.SendChatMessage("SpaceIndex of '" + argshPlayer.svPlayer.playerData.username + "': " + argshPlayer.GetPlaceIndex());
                break;
            }

            case "createidlist":
            {
                string arg2 = GetArgument.Run(2, false, true, message);
                if (string.IsNullOrEmpty(arg2))
                {
                    player.SendChatMessage("Please select idlist type: /debug createidlist item/vehicle/skinid");
                    return;
                }
                arg2 = arg2.Trim().ToLower();
                if (arg2 != "item" && arg2 != "vehicle" && arg2 != "skinid")
                {
                    player.SendChatMessage("Please select idlist type: /debug createidlist item/vehicle/skinid (Invalid value given as second arument)");
                    return;
                }
                player.SendChatMessage("Creating ID list.. please wait");
                var location = $"{FileDirectory}IDLists/{arg2}/IDLIST_{DateTime.Now.ToString("yyyy_mm_dd_hh_mm_ss")}.txt";
                if (!Directory.Exists($"{FileDirectory}IDLists/{arg2}"))
                {
                    Directory.CreateDirectory($"{FileDirectory}IDLists/{arg2}");
                }
                var sb        = new StringBuilder();
                int currIndex = 0;
                sb.Append("{\"items\": [");
                if (arg2 == "skinid")
                {
                    for (int i = 0; i < shPlayer.manager.skinPrefabs.Length; i++)
                    {
                        sb.Append($"{{\"name\": \"{shPlayer.manager.skinPrefabs[i].name}\",\"id\": {currIndex},\"gameid\": {Animator.StringToHash(shPlayer.manager.skinPrefabs[i].name)}}},\n");
                        ++currIndex;
                    }
                }
                else
                {
                    var itemsAdded = new List <int>();
                    foreach (var entity in Builder.pb_Scene.instance.entityCollection)
                    {
                        if (entity == null)
                        {
                            continue;
                        }
                        if (((arg2 == "item" && entity is ShItem) || (arg2 == "vehicle" && entity is ShTransport && !(entity is ShParachute))) && !itemsAdded.Contains(entity.index))
                        {
                            sb.Append($"{{\"name\": \"{entity.name.Replace("(Clone)", "")}\",\"id\": {++currIndex},\"gameid\": {entity.index}}},\n");
                            itemsAdded.Add(entity.index);
                        }
                    }
                }
                File.WriteAllText(location, $"{sb.Remove(sb.Length - 2, 1)}]}}");

                player.SendChatMessage($"Success! ID List has been saved in {location}. ({currIndex} entries.)");
                break;
            }

            case "jobarray":
                player.SendChatMessage($"Jobs array: (Length: {Jobs.Length}) {string.Join(", ", Jobs)}");
                break;

            case "tpall":
            {
                foreach (var currPlayer in UnityEngine.Object.FindObjectsOfType <SvPlayer>())
                {
                    currPlayer.ResetAndSavePosition(shPlayer.GetPosition(), shPlayer.GetRotation(), shPlayer.GetPlaceIndex());
                }
                break;
            }

            case "addcrimes":
                player.SvAddCrime(CrimeIndex.Murder, null);
                break;

            case "disconnecttest":
                player.Send(SvSendType.AllOthers, Channel.Unsequenced, ClPacket.DestroyEntity, player.player.ID);
                break;

            case "setmaxapartmententities":
                player.entity.manager.apartmentLimit = 300;
                player.SendChatMessage("success");
                break;

            case "getmaxapartmententities":
                player.SendChatMessage($"Max entities: {player.entity.manager.apartmentLimit}");
                break;

            default:
                player.SendChatMessage("/debug location/getplayerhash/getspaceindex/createidlist/jobarray");
                break;
            }
        }