// PlayerLoot.StartLootingItem() public static void StartLootingItem(PlayerLoot playerLoot, BasePlayer looter, Item item) { // works, event needed var ile = new Events.ItemLootEvent(playerLoot, new Player(looter), item); OnLootingItem.OnNext(ile); }
// PlayerLoot.StartLootingItem() public static void On_LootingItem(PlayerLoot playerLoot) { BasePlayer looter = playerLoot.GetComponent <BasePlayer>(); var ile = new Events.ItemLootEvent(playerLoot, Server.GetPlayer(looter), playerLoot.itemSource); OnNext("On_LootingItem", ile); if (ile.Cancel) { playerLoot.Clear(); looter.SendConsoleCommand("chat.add", 0, String.Format("{0}: {1}", Server.server_message_name.ColorText("fa5"), ile.cancelReason)); } }
// PlayerLoot.StartLootingItem() public static void StartLootingItem(PlayerLoot playerLoot) { BasePlayer looter = playerLoot.GetComponent<BasePlayer>(); var ile = new Events.ItemLootEvent(playerLoot, Server.GetPlayer(looter), playerLoot.itemSource); OnLootingItem.OnNext(ile); if (ile.Cancel) { playerLoot.Clear(); looter.SendConsoleCommand("chat.add", 0, String.Format("{0}: {1}", Server.server_message_name.ColorText("fa5"), ile.cancelReason)); } }