コード例 #1
0
        //Used by:
        //Tranquilizer
        //SCP-1499
        private void OnDrop(PlayerDropItemEventArgs ev)
        {
            if (ev.Player.GetComponent <TranquilizerPlayerScript>().Stuned)
            {
                ev.Allow = false;
                return;
            }

            switch (ev.Item?.ID)
            {
            case (int)CustomItemType.Scp1499 when ev.Player.GetComponent <Scp1499PlayerScript>().IsInDimension:
                ev.Allow = false;

                ev.Player.GiveTextHint(PluginClass.Translation.ActiveTranslation.Drop1499);
                break;
            }
        }
コード例 #2
0
ファイル: PlayerEvents.cs プロジェクト: Mika-Westphal/Synapse
        internal void InvokePlayerDropItemPatch(Player player, Items.SynapseItem item, out bool allow)
        {
            allow = true;
            if (PlayerDropItemEvent == null)
            {
                return;
            }

            var ev = new PlayerDropItemEventArgs
            {
                Player = player,
                Item   = item,
                Allow  = true,
            };

            PlayerDropItemEvent.Invoke(ev);

            allow = ev.Allow;
        }