Esempio n. 1
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            var steamPlayer  = PlayerTool.getSteamPlayer(executorID);
            var thingLocated = TraceRay(steamPlayer, 2048f,
                                        RayMasks.VEHICLE | RayMasks.BARRICADE | RayMasks.STRUCTURE | RayMasks.BARRICADE_INTERACT |
                                        RayMasks.STRUCTURE_INTERACT);

            if (thingLocated.transform == null)
            {
                ChatManager.SendServerMessage("Could not find barricade", steamPlayer, EChatMode.SAY);
                return;
            }

            var component = thingLocated.transform.GetComponent <Interactable2>();

            if (component?.transform == null)
            {
                ChatManager.SendServerMessage("Could not find barricade", steamPlayer, EChatMode.SAY);
                return;
            }

            var ownerId = (CSteamID)component.owner;

            ChatManager.SendServerMessage($"Owner: {ownerId}", steamPlayer, EChatMode.SAY);
        }
Esempio n. 2
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (Provider.server.Equals(executorID))
            {
                return;
            }
            var steamPlayer = PlayerTool.getSteamPlayer(executorID);

            if (PlayerManager.GodPlayers.Contains(steamPlayer))
            {
                ChatManager.SendServerMessage("You are no longer god", steamPlayer, EChatMode.SAY);
                PlayerManager.GodPlayers.Remove(steamPlayer);
            }
            else
            {
                ChatManager.SendServerMessage("You are now god", steamPlayer, EChatMode.SAY);
                PlayerManager.GodPlayers.Add(steamPlayer);
            }
        }
Esempio n. 3
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            var steamPlayer = PlayerTool.getSteamPlayer(executorID);

            for (byte page = 0; page < 6; page++)
            {
                for (byte i = 0; i < steamPlayer.player.inventory.items[page].getItemCount(); i++)
                {
                    var item = steamPlayer.player.inventory.items[page].getItem(i);
                    steamPlayer.player.inventory.removeItem(page, steamPlayer.player.inventory.getIndex(page, item.x, item.y));
                }
            }

            void RemoveUnequipped()
            {
                for (byte i = 0; i < steamPlayer.player.inventory.getItemCount(2); i++)
                {
                    steamPlayer.player.inventory.removeItem(2, 0);
                }
            }

            steamPlayer.player.clothing.askWearBackpack(0, 0, new byte[0], true);
            RemoveUnequipped();
            steamPlayer.player.clothing.askWearGlasses(0, 0, new byte[0], true);
            RemoveUnequipped();
            steamPlayer.player.clothing.askWearHat(0, 0, new byte[0], true);
            RemoveUnequipped();
            steamPlayer.player.clothing.askWearPants(0, 0, new byte[0], true);
            RemoveUnequipped();
            steamPlayer.player.clothing.askWearMask(0, 0, new byte[0], true);
            RemoveUnequipped();
            steamPlayer.player.clothing.askWearShirt(0, 0, new byte[0], true);
            RemoveUnequipped();
            steamPlayer.player.clothing.askWearVest(0, 0, new byte[0], true);
            RemoveUnequipped();

            ChatManager.SendServerMessage("Cleared inventory!", steamPlayer, EChatMode.SAY);
        }
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (Provider.server.Equals(executorID))
            {
                return;
            }
            var steamPlayer = PlayerTool.getSteamPlayer(executorID);

            var look     = steamPlayer.player.look;
            var movement = steamPlayer.player.movement;
            var vanished = !movement.canAddSimulationResultsToUpdates;

            if (vanished)
            {
                ChatManager.SendServerMessage("You are no longer vanished", steamPlayer, EChatMode.SAY);
                movement.updates.Add(new PlayerStateUpdate(movement.real, look.angle, look.rot));
            }
            else
            {
                ChatManager.SendServerMessage("You are now vanished", steamPlayer, EChatMode.SAY);
            }

            steamPlayer.player.movement.canAddSimulationResultsToUpdates = vanished;
        }