House.House.onPlayerOpenChest C# (CSharp) Méthode

onPlayerOpenChest() public méthode

public onPlayerOpenChest ( PlayerChestOpenEvent Event ) : void
Event PlayerChestOpenEvent
Résultat void
        public override void onPlayerOpenChest(PlayerChestOpenEvent Event)
        {
            Player player = Server.GetPlayerByName(Event.Sender.Name);
            if (IsInsideAnotherHouse(player.Name, (int)Server.chest[Event.ID].x, (int)Server.chest[Event.ID].y, CHECK_CHEST_LOCK) &&
                !player.Op)
            {
                Event.Cancelled = true;
                player.sendMessage("You cannot open this chest, it's locked and inside someone else's house", chatColor);
            }
            base.onPlayerOpenChest(Event);
        }