예제 #1
0
 public void On_LootingEntity(EntityLootEvent ele)
 {
     SetHookWorking("On_LootingEntity");
     Broadcast(ele.Target.Name + " is being looted by " + ele.Looter.Name);
 }
예제 #2
0
파일: Hooks.cs 프로젝트: Notulp/Pluton.Rust
        /// <summary>
        /// Called from <c>PlayerLoot.StartLootingEntity(BaseEntity, bool)</c> .
        /// </summary>
        public static void On_LootingEntity(PlayerLoot playerLoot)
        {
            BasePlayer looter = playerLoot.GetComponent<BasePlayer>();
            var ele = new 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));
            }
        }
예제 #3
0
 public void OnLootingEntity(EntityLootEvent le)
 {
     this.Invoke("On_LootingEntity", le);
 }