Esempio n. 1
0
 /// <summary>
 /// Loot the given container
 /// </summary>
 /// <param name="player"></param>
 /// <param name="container"></param>
 /// <returns></returns>
 private bool LootContainer(BasePlayer player, StorageContainer container)
 {
     if (container.IsLocked())
     {
         player.ChatMessage(Lang("CantLoot", player.UserIDString));
         return(false);
     }
     if (!container.CanOpenLootPanel(player, container.panelName))
     {
         return(false);
     }
     container.SetFlag(BaseEntity.Flags.Open, true, false);
     using (TimeWarning.New("PlayerOpenLoot", 0.1f))
     {
         player.inventory.loot.StartLootingEntity(container, false);
         player.inventory.loot.AddContainer(container.inventory);
         player.inventory.loot.SendImmediate();
         player.ClientRPCPlayer(null, player, "RPC_OpenLootPanel", container.panelName);
         container.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
     }
     return(true);
 }
Esempio n. 2
0
 private static bool CheckContPrivilege(StorageContainer cont, BasePlayer p) => cont.CanOpenLootPanel(p) && CheckBuildingPrivilege(p);