//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; } }
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; }