Exemplo n.º 1
0
        // PlayerLoot.StartLootingEntity()
        public static void StartLootingEntity(PlayerLoot playerLoot, BasePlayer looter, BaseEntity entity)
        {
            // not tested, what is a lootable entity anyway?

            var ele = new Events.EntityLootEvent(playerLoot, new Player(looter), new Entity(entity));

            OnLootingEntity.OnNext(ele);
        }
Exemplo n.º 2
0
        // PlayerLoot.StartLootingEntity()
        public static void On_LootingEntity(PlayerLoot playerLoot)
        {
            BasePlayer looter = playerLoot.GetComponent <BasePlayer>();
            var        ele    = new Events.EntityLootEvent(playerLoot, Server.GetPlayer(looter), new Entity(playerLoot.entitySource));

            OnNext("On_LootingEntity", ele);

            if (ele.Cancel)
            {
                playerLoot.Clear();
                looter.SendConsoleCommand("chat.add", 0, String.Format("{0}: {1}", Server.server_message_name.ColorText("fa5"), ele.cancelReason));
            }
        }
Exemplo n.º 3
0
        // PlayerLoot.StartLootingEntity()
        public static void StartLootingEntity(PlayerLoot playerLoot)
        {
            BasePlayer looter = playerLoot.GetComponent<BasePlayer>();
            var ele = new Events.EntityLootEvent(playerLoot, Server.GetPlayer(looter), new Entity(playerLoot.entitySource));
            OnLootingEntity.OnNext(ele);

            if (ele.Cancel) {
                playerLoot.Clear();
                looter.SendConsoleCommand("chat.add", 0, String.Format("{0}: {1}", Server.server_message_name.ColorText("fa5"), ele.cancelReason));
            }
        }