Esempio n. 1
0
        public static void giveall(Arg arg)
        {
            Item   item = null;
            string text = "SERVER";

            if (ArgEx.Player(arg) != null)
            {
                text = ArgEx.Player(arg).displayName;
            }
            foreach (BasePlayer activePlayer in BasePlayer.activePlayerList)
            {
                item = ItemManager.CreateByPartialName(arg.GetString(0), 1, 0uL);
                if (item == null)
                {
                    arg.ReplyWith("Invalid Item!");
                    return;
                }
                item.amount = arg.GetInt(1, 1);
                item.OnVirginSpawn();
                if (!activePlayer.inventory.GiveItem(item))
                {
                    item.Remove();
                    arg.ReplyWith("Couldn't give item (inventory full?)");
                    continue;
                }
                activePlayer.Command("note.inv", item.info.itemid, item.amount);
                Debug.Log(" [ServerVar] giving " + activePlayer.displayName + " " + item.amount + " x " + item.info.displayName.english);
            }
            if (item != null)
            {
                Chat.Broadcast(text + " gave everyone " + item.amount + " x " + item.info.displayName.english, "SERVER", "#eee", 0uL);
            }
        }
Esempio n. 2
0
        public static void giveto(Arg arg)
        {
            string text = "SERVER";

            if (ArgEx.Player(arg) != null)
            {
                text = ArgEx.Player(arg).displayName;
            }
            BasePlayer basePlayer = BasePlayer.Find(arg.GetString(0));

            if (basePlayer == null)
            {
                arg.ReplyWith("Couldn't find player!");
                return;
            }
            Item item = ItemManager.CreateByPartialName(arg.GetString(1), 1, arg.GetULong(3, 0uL));

            if (item == null)
            {
                arg.ReplyWith("Invalid Item!");
                return;
            }
            item.amount = arg.GetInt(2, 1);
            item.OnVirginSpawn();
            if (!basePlayer.inventory.GiveItem(item))
            {
                item.Remove();
                arg.ReplyWith("Couldn't give item (inventory full?)");
                return;
            }
            basePlayer.Command("note.inv", item.info.itemid, item.amount);
            Debug.Log(" [ServerVar] giving " + basePlayer.displayName + " " + item.amount + " x " + item.info.displayName.english);
            Chat.Broadcast(text + " gave " + basePlayer.displayName + " " + item.amount + " x " + item.info.displayName.english, "SERVER", "#eee", 0uL);
        }
        public static void givearm(ConsoleSystem.Arg arg)
        {
            BasePlayer basePlayer = arg.Player();

            if (!basePlayer)
            {
                return;
            }
            Item num = ItemManager.CreateByItemID(arg.GetInt(0, 0), 1, (ulong)0);

            if (num == null)
            {
                arg.ReplyWith("Invalid Item!");
                return;
            }
            num.amount = arg.GetInt(1, 1);
            num.OnVirginSpawn();
            if (!basePlayer.inventory.GiveItem(num, basePlayer.inventory.containerBelt))
            {
                num.Remove(0f);
                arg.ReplyWith("Couldn't give item (inventory full?)");
                return;
            }
            basePlayer.Command("note.inv", new object[] { num.info.itemid, num.amount });
            Debug.Log(string.Concat(new object[] { " [ServerVar] giving ", basePlayer.displayName, " ", num.amount, " x ", num.info.displayName.english }));
            Chat.Broadcast(string.Concat(new object[] { basePlayer.displayName, " gave themselves ", num.amount, " x ", num.info.displayName.english }), "SERVER", "#eee", (ulong)0);
        }
Esempio n. 4
0
        public static void ban(ConsoleSystem.Arg arg)
        {
            BasePlayer player = arg.GetPlayer(0);

            if (!player || player.net == null || player.net.connection == null)
            {
                arg.ReplyWith("Player not found");
                return;
            }
            ServerUsers.User user = ServerUsers.Get(player.userID);
            if (user != null && user.@group == ServerUsers.UserGroup.Banned)
            {
                arg.ReplyWith(string.Concat("User ", player.userID, " is already banned"));
                return;
            }
            string str = arg.GetString(1, "No Reason Given");

            ServerUsers.Set(player.userID, ServerUsers.UserGroup.Banned, player.displayName, str);
            string str1 = "";

            if (player.IsConnected && player.net.connection.ownerid != player.net.connection.userid)
            {
                str1 = string.Concat(str1, " and also banned ownerid ", player.net.connection.ownerid);
                ServerUsers.Set(player.net.connection.ownerid, ServerUsers.UserGroup.Banned, player.displayName, arg.GetString(1, string.Concat("Family share owner of ", player.net.connection.userid)));
            }
            ServerUsers.Save();
            arg.ReplyWith(string.Concat(new object[] { "Kickbanned User: "******" - ", player.displayName, str1 }));
            Chat.Broadcast(string.Concat(new string[] { "Kickbanning ", player.displayName, " (", str, ")" }), "SERVER", "#eee", (ulong)0);
            Network.Net.sv.Kick(player.net.connection, string.Concat("Banned: ", str));
        }
Esempio n. 5
0
        public static void givearm(ConsoleSystem.Arg arg)
        {
            BasePlayer basePlayer = arg.Player();

            if (!Object.op_Implicit((Object)basePlayer))
            {
                return;
            }
            Item byItemId = ItemManager.CreateByItemID(arg.GetInt(0, 0), 1, 0UL);

            if (byItemId == null)
            {
                arg.ReplyWith("Invalid Item!");
            }
            else
            {
                byItemId.amount = arg.GetInt(1, 1);
                byItemId.OnVirginSpawn();
                if (!basePlayer.inventory.GiveItem(byItemId, basePlayer.inventory.containerBelt))
                {
                    byItemId.Remove(0.0f);
                    arg.ReplyWith("Couldn't give item (inventory full?)");
                }
                else
                {
                    basePlayer.Command("note.inv", (object)byItemId.info.itemid, (object)byItemId.amount);
                    Debug.Log((object)(" [ServerVar] giving " + basePlayer.displayName + " " + (object)byItemId.amount + " x " + byItemId.info.displayName.english));
                    Chat.Broadcast(basePlayer.displayName + " gave themselves " + (object)byItemId.amount + " x " + byItemId.info.displayName.english, "SERVER", "#eee", 0UL);
                }
            }
        }
Esempio n. 6
0
        public static void give(ConsoleSystem.Arg arg)
        {
            BasePlayer basePlayer = arg.Player();

            if (!Object.op_Implicit((Object)basePlayer))
            {
                return;
            }
            Item byPartialName = ItemManager.CreateByPartialName(arg.GetString(0, ""), 1);

            if (byPartialName == null)
            {
                arg.ReplyWith("Invalid Item!");
            }
            else
            {
                int num1 = arg.GetInt(1, 1);
                byPartialName.amount = num1;
                float num2 = arg.GetFloat(2, 1f);
                byPartialName.conditionNormalized = num2;
                byPartialName.OnVirginSpawn();
                if (!basePlayer.inventory.GiveItem(byPartialName, (ItemContainer)null))
                {
                    byPartialName.Remove(0.0f);
                    arg.ReplyWith("Couldn't give item (inventory full?)");
                }
                else
                {
                    basePlayer.Command("note.inv", (object)byPartialName.info.itemid, (object)num1);
                    Debug.Log((object)("giving " + basePlayer.displayName + " " + (object)num1 + " x " + byPartialName.info.displayName.english));
                    Chat.Broadcast(basePlayer.displayName + " gave themselves " + (object)num1 + " x " + byPartialName.info.displayName.english, "SERVER", "#eee", 0UL);
                }
            }
        }
        public static void giveto(ConsoleSystem.Arg arg)
        {
            string str = "SERVER";

            if (arg.Player() != null)
            {
                str = arg.Player().displayName;
            }
            BasePlayer basePlayer = BasePlayer.Find(arg.GetString(0, ""));

            if (basePlayer == null)
            {
                arg.ReplyWith("Couldn't find player!");
                return;
            }
            Item num = ItemManager.CreateByPartialName(arg.GetString(1, ""), 1);

            if (num == null)
            {
                arg.ReplyWith("Invalid Item!");
                return;
            }
            num.amount = arg.GetInt(2, 1);
            num.OnVirginSpawn();
            if (!basePlayer.inventory.GiveItem(num, null))
            {
                num.Remove(0f);
                arg.ReplyWith("Couldn't give item (inventory full?)");
                return;
            }
            basePlayer.Command("note.inv", new object[] { num.info.itemid, num.amount });
            Debug.Log(string.Concat(new object[] { " [ServerVar] giving ", basePlayer.displayName, " ", num.amount, " x ", num.info.displayName.english }));
            Chat.Broadcast(string.Concat(new object[] { str, " gave ", basePlayer.displayName, " ", num.amount, " x ", num.info.displayName.english }), "SERVER", "#eee", (ulong)0);
        }
        public static void give(ConsoleSystem.Arg arg)
        {
            BasePlayer basePlayer = arg.Player();

            if (!basePlayer)
            {
                return;
            }
            Item num = ItemManager.CreateByPartialName(arg.GetString(0, ""), 1);

            if (num == null)
            {
                arg.ReplyWith("Invalid Item!");
                return;
            }
            int num1 = arg.GetInt(1, 1);

            num.amount = num1;
            num.conditionNormalized = arg.GetFloat(2, 1f);
            num.OnVirginSpawn();
            if (!basePlayer.inventory.GiveItem(num, null))
            {
                num.Remove(0f);
                arg.ReplyWith("Couldn't give item (inventory full?)");
                return;
            }
            basePlayer.Command("note.inv", new object[] { num.info.itemid, num1 });
            Debug.Log(string.Concat(new object[] { "giving ", basePlayer.displayName, " ", num1, " x ", num.info.displayName.english }));
            Chat.Broadcast(string.Concat(new object[] { basePlayer.displayName, " gave themselves ", num1, " x ", num.info.displayName.english }), "SERVER", "#eee", (ulong)0);
        }
Esempio n. 9
0
        public static void ban(ConsoleSystem.Arg arg)
        {
            BasePlayer player = arg.GetPlayer(0);

            if (!Object.op_Implicit((Object)player) || player.net == null || player.net.get_connection() == null)
            {
                arg.ReplyWith("Player not found");
            }
            else
            {
                ServerUsers.User user = ServerUsers.Get(player.userID);
                if (user != null && user.group == ServerUsers.UserGroup.Banned)
                {
                    arg.ReplyWith("User " + (object)player.userID + " is already banned");
                }
                else
                {
                    string notes = arg.GetString(1, "No Reason Given");
                    ServerUsers.Set(player.userID, ServerUsers.UserGroup.Banned, player.displayName, notes);
                    string str = "";
                    if (player.IsConnected && player.net.get_connection().ownerid != player.net.get_connection().userid)
                    {
                        str = str + " and also banned ownerid " + (object)(ulong)player.net.get_connection().ownerid;
                        ServerUsers.Set((ulong)player.net.get_connection().ownerid, ServerUsers.UserGroup.Banned, player.displayName, arg.GetString(1, "Family share owner of " + (object)(ulong)player.net.get_connection().userid));
                    }
                    ServerUsers.Save();
                    arg.ReplyWith("Kickbanned User: "******" - " + player.displayName + str);
                    Chat.Broadcast("Kickbanning " + player.displayName + " (" + notes + ")", "SERVER", "#eee", 0UL);
                    ((Server)Net.sv).Kick(player.net.get_connection(), "Banned: " + notes);
                }
            }
        }
Esempio n. 10
0
        public static void ban(Arg arg)
        {
            BasePlayer player = ArgEx.GetPlayer(arg, 0);

            if (!player || player.net == null || player.net.connection == null)
            {
                arg.ReplyWith("Player not found");
                return;
            }
            ServerUsers.User user = ServerUsers.Get(player.userID);
            if (user != null && user.group == ServerUsers.UserGroup.Banned)
            {
                arg.ReplyWith($"User {player.userID} is already banned");
                return;
            }
            string @string = arg.GetString(1, "No Reason Given");
            long   expiry;
            string durationSuffix;

            if (TryGetBanExpiry(arg, 2, out expiry, out durationSuffix))
            {
                ServerUsers.Set(player.userID, ServerUsers.UserGroup.Banned, player.displayName, @string, expiry);
                string text = "";
                if (player.IsConnected && player.net.connection.ownerid != 0L && player.net.connection.ownerid != player.net.connection.userid)
                {
                    text += $" and also banned ownerid {player.net.connection.ownerid}";
                    ServerUsers.Set(player.net.connection.ownerid, ServerUsers.UserGroup.Banned, player.displayName, arg.GetString(1, $"Family share owner of {player.net.connection.userid}"), -1L);
                }
                ServerUsers.Save();
                arg.ReplyWith($"Kickbanned User{durationSuffix}: {player.userID} - {player.displayName}{text}");
                Chat.Broadcast("Kickbanning " + player.displayName + durationSuffix + " (" + @string + ")", "SERVER", "#eee", 0uL);
                Network.Net.sv.Kick(player.net.connection, "Banned" + durationSuffix + ": " + @string);
            }
        }
Esempio n. 11
0
        public static void givearm(Arg arg)
        {
            BasePlayer basePlayer = ArgEx.Player(arg);

            if (!basePlayer)
            {
                return;
            }
            Item item = ItemManager.CreateByItemID(arg.GetInt(0), 1, 0uL);

            if (item == null)
            {
                arg.ReplyWith("Invalid Item!");
                return;
            }
            item.amount = arg.GetInt(1, 1);
            item.OnVirginSpawn();
            if (!basePlayer.inventory.GiveItem(item, basePlayer.inventory.containerBelt))
            {
                item.Remove();
                arg.ReplyWith("Couldn't give item (inventory full?)");
                return;
            }
            basePlayer.Command("note.inv", item.info.itemid, item.amount);
            Debug.Log(" [ServerVar] giving " + basePlayer.displayName + " " + item.amount + " x " + item.info.displayName.english);
            if (basePlayer.IsDeveloper)
            {
                basePlayer.ChatMessage("you silently gave yourself " + item.amount + " x " + item.info.displayName.english);
            }
            else
            {
                Chat.Broadcast(basePlayer.displayName + " gave themselves " + item.amount + " x " + item.info.displayName.english, "SERVER", "#eee", 0uL);
            }
        }
Esempio n. 12
0
        public static void kick(Arg arg)
        {
            BasePlayer player = ArgEx.GetPlayer(arg, 0);

            if (!player || player.net == null || player.net.connection == null)
            {
                arg.ReplyWith("Player not found");
                return;
            }
            string @string = arg.GetString(1, "no reason given");

            arg.ReplyWith("Kicked: " + player.displayName);
            Chat.Broadcast("Kicking " + player.displayName + " (" + @string + ")", "SERVER", "#eee", 0uL);
            player.Kick("Kicked: " + arg.GetString(1, "No Reason Given"));
        }
Esempio n. 13
0
        public static void kick(ConsoleSystem.Arg arg)
        {
            BasePlayer player = arg.GetPlayer(0);

            if (!player || player.net == null || player.net.connection == null)
            {
                arg.ReplyWith("Player not found");
                return;
            }
            string str = arg.GetString(1, "no reason given");

            arg.ReplyWith(string.Concat("Kicked: ", player.displayName));
            Chat.Broadcast(string.Concat(new string[] { "Kicking ", player.displayName, " (", str, ")" }), "SERVER", "#eee", (ulong)0);
            player.Kick(string.Concat("Kicked: ", arg.GetString(1, "No Reason Given")));
        }
Esempio n. 14
0
        public static void kick(ConsoleSystem.Arg arg)
        {
            BasePlayer player = arg.GetPlayer(0);

            if (!Object.op_Implicit((Object)player) || player.net == null || player.net.get_connection() == null)
            {
                arg.ReplyWith("Player not found");
            }
            else
            {
                string str = arg.GetString(1, "no reason given");
                arg.ReplyWith("Kicked: " + player.displayName);
                Chat.Broadcast("Kicking " + player.displayName + " (" + str + ")", "SERVER", "#eee", 0UL);
                player.Kick("Kicked: " + arg.GetString(1, "No Reason Given"));
            }
        }
Esempio n. 15
0
        public static void banid(Arg arg)
        {
            ulong  uInt    = arg.GetUInt64(0, 0uL);
            string text    = arg.GetString(1, "unnamed");
            string @string = arg.GetString(2, "no reason");

            if (uInt < 70000000000000000L)
            {
                arg.ReplyWith("This doesn't appear to be a 64bit steamid: " + uInt);
                return;
            }
            ServerUsers.User user = ServerUsers.Get(uInt);
            if (user != null && user.group == ServerUsers.UserGroup.Banned)
            {
                arg.ReplyWith("User " + uInt + " is already banned");
            }
            else
            {
                long   expiry;
                string durationSuffix;
                if (!TryGetBanExpiry(arg, 3, out expiry, out durationSuffix))
                {
                    return;
                }
                string     text2      = "";
                BasePlayer basePlayer = BasePlayer.FindByID(uInt);
                if (basePlayer != null && basePlayer.IsConnected)
                {
                    text = basePlayer.displayName;
                    if (basePlayer.IsConnected && basePlayer.net.connection.ownerid != 0L && basePlayer.net.connection.ownerid != basePlayer.net.connection.userid)
                    {
                        text2 += $" and also banned ownerid {basePlayer.net.connection.ownerid}";
                        ServerUsers.Set(basePlayer.net.connection.ownerid, ServerUsers.UserGroup.Banned, basePlayer.displayName, arg.GetString(1, $"Family share owner of {basePlayer.net.connection.userid}"), expiry);
                    }
                    Chat.Broadcast("Kickbanning " + basePlayer.displayName + durationSuffix + " (" + @string + ")", "SERVER", "#eee", 0uL);
                    Network.Net.sv.Kick(basePlayer.net.connection, "Banned" + durationSuffix + ": " + @string);
                }
                ServerUsers.Set(uInt, ServerUsers.UserGroup.Banned, text, @string, expiry);
                arg.ReplyWith($"Banned User{durationSuffix}: {uInt} - \"{text}\" for \"{@string}\"{text2}");
            }
        }
Esempio n. 16
0
        public static void giveto(ConsoleSystem.Arg arg)
        {
            string str = "SERVER";

            if (Object.op_Inequality((Object)arg.Player(), (Object)null))
            {
                str = arg.Player().displayName;
            }
            BasePlayer basePlayer = BasePlayer.Find(arg.GetString(0, ""));

            if (Object.op_Equality((Object)basePlayer, (Object)null))
            {
                arg.ReplyWith("Couldn't find player!");
            }
            else
            {
                Item byPartialName = ItemManager.CreateByPartialName(arg.GetString(1, ""), 1);
                if (byPartialName == null)
                {
                    arg.ReplyWith("Invalid Item!");
                }
                else
                {
                    byPartialName.amount = arg.GetInt(2, 1);
                    byPartialName.OnVirginSpawn();
                    if (!basePlayer.inventory.GiveItem(byPartialName, (ItemContainer)null))
                    {
                        byPartialName.Remove(0.0f);
                        arg.ReplyWith("Couldn't give item (inventory full?)");
                    }
                    else
                    {
                        basePlayer.Command("note.inv", (object)byPartialName.info.itemid, (object)byPartialName.amount);
                        Debug.Log((object)(" [ServerVar] giving " + basePlayer.displayName + " " + (object)byPartialName.amount + " x " + byPartialName.info.displayName.english));
                        Chat.Broadcast(str + " gave " + basePlayer.displayName + " " + (object)byPartialName.amount + " x " + byPartialName.info.displayName.english, "SERVER", "#eee", 0UL);
                    }
                }
            }
        }
Esempio n. 17
0
        public static void giveall(ConsoleSystem.Arg arg)
        {
            Item   obj = (Item)null;
            string str = "SERVER";

            if (Object.op_Inequality((Object)arg.Player(), (Object)null))
            {
                str = arg.Player().displayName;
            }
            foreach (BasePlayer activePlayer in BasePlayer.activePlayerList)
            {
                obj = ItemManager.CreateByPartialName(arg.GetString(0, ""), 1);
                if (obj == null)
                {
                    arg.ReplyWith("Invalid Item!");
                    return;
                }
                obj.amount = arg.GetInt(1, 1);
                obj.OnVirginSpawn();
                if (!activePlayer.inventory.GiveItem(obj, (ItemContainer)null))
                {
                    obj.Remove(0.0f);
                    arg.ReplyWith("Couldn't give item (inventory full?)");
                }
                else
                {
                    activePlayer.Command("note.inv", (object)obj.info.itemid, (object)obj.amount);
                    Debug.Log((object)(" [ServerVar] giving " + activePlayer.displayName + " " + (object)obj.amount + " x " + obj.info.displayName.english));
                }
            }
            if (obj == null)
            {
                return;
            }
            Chat.Broadcast(str + " gave everyone " + (object)obj.amount + " x " + obj.info.displayName.english, "SERVER", "#eee", 0UL);
        }
Esempio n. 18
0
        public static void give(Arg arg)
        {
            BasePlayer basePlayer = ArgEx.Player(arg);

            if (!basePlayer)
            {
                return;
            }
            Item item = ItemManager.CreateByPartialName(arg.GetString(0), 1, arg.GetULong(3, 0uL));

            if (item == null)
            {
                arg.ReplyWith("Invalid Item!");
                return;
            }
            int   num  = (item.amount = arg.GetInt(1, 1));
            float num2 = (item.conditionNormalized = arg.GetFloat(2, 1f));

            item.OnVirginSpawn();
            if (!basePlayer.inventory.GiveItem(item))
            {
                item.Remove();
                arg.ReplyWith("Couldn't give item (inventory full?)");
                return;
            }
            basePlayer.Command("note.inv", item.info.itemid, num);
            Debug.Log("giving " + basePlayer.displayName + " " + num + " x " + item.info.displayName.english);
            if (basePlayer.IsDeveloper)
            {
                basePlayer.ChatMessage("you silently gave yourself " + num + " x " + item.info.displayName.english);
            }
            else
            {
                Chat.Broadcast(basePlayer.displayName + " gave themselves " + num + " x " + item.info.displayName.english, "SERVER", "#eee", 0uL);
            }
        }
Esempio n. 19
0
 public static void say(ConsoleSystem.Arg arg)
 {
     Chat.Broadcast((string)arg.FullString, "SERVER", "#eee", 0UL);
 }
Esempio n. 20
0
 public static void say(Arg arg)
 {
     Chat.Broadcast(arg.FullString, "SERVER", "#eee", 0uL);
 }
Esempio n. 21
0
 public static void say(ConsoleSystem.Arg arg)
 {
     Chat.Broadcast(arg.FullString, "SERVER", "#eee", (ulong)0);
 }
Esempio n. 22
0
        public static void copyTo(Arg arg)
        {
            BasePlayer basePlayer = ArgEx.Player(arg);

            if ((!basePlayer.IsAdmin && !basePlayer.IsDeveloper && !Server.cinematic) || basePlayer == null)
            {
                return;
            }
            BasePlayer basePlayer2 = null;

            if (arg.HasArgs() && arg.GetString(0).ToLower() != "true")
            {
                basePlayer2 = ArgEx.GetPlayer(arg, 0);
                if (basePlayer2 == null)
                {
                    uint uInt = arg.GetUInt(0);
                    basePlayer2 = BasePlayer.FindByID(uInt);
                    if (basePlayer2 == null)
                    {
                        basePlayer2 = BasePlayer.FindBot(uInt);
                    }
                }
            }
            else
            {
                basePlayer2 = RelationshipManager.GetLookingAtPlayer(basePlayer);
            }
            if (basePlayer2 == null)
            {
                return;
            }
            basePlayer2.inventory.containerBelt.Clear();
            basePlayer2.inventory.containerWear.Clear();
            int num = 0;

            foreach (Item item2 in basePlayer.inventory.containerBelt.itemList)
            {
                basePlayer2.inventory.containerBelt.AddItem(item2.info, item2.amount, item2.skin);
                if (item2.contents != null)
                {
                    Item item = basePlayer2.inventory.containerBelt.itemList[num];
                    foreach (Item item3 in item2.contents.itemList)
                    {
                        item.contents.AddItem(item3.info, item3.amount, item3.skin);
                    }
                }
                num++;
            }
            foreach (Item item4 in basePlayer.inventory.containerWear.itemList)
            {
                basePlayer2.inventory.containerWear.AddItem(item4.info, item4.amount, item4.skin);
            }
            if (basePlayer.IsDeveloper)
            {
                basePlayer.ChatMessage("you silently copied items to " + basePlayer2.displayName);
            }
            else
            {
                Chat.Broadcast(basePlayer.displayName + " copied their inventory to " + basePlayer2.displayName, "SERVER", "#eee", 0uL);
            }
        }