private void OnMedicalItemDeEquipped(DequippedMedicalItemEventArgs ev) { if (!Check(ev.Player.CurrentItem)) { return; } if (scp1499Players.ContainsKey(ev.Player)) { scp1499Players[ev.Player] = ev.Player.Position; } else { scp1499Players.Add(ev.Player, ev.Player.Position); } ev.Player.Position = scp1499DimensionPos; ev.Player.ReferenceHub.playerEffectsController.DisableEffect <Scp268>(); if (Duration > 0) { Timing.CallDelayed(Duration, () => { SendPlayerBack(ev.Player); }); } }
private static void Prefix(ConsumableAndWearableItems __instance, ConsumableAndWearableItems.HealAnimation healAnimation, int mid) { try { if (healAnimation == ConsumableAndWearableItems.HealAnimation.DequipMedicalItem) { var ev = new DequippedMedicalItemEventArgs(API.Features.Player.Get(__instance.gameObject), __instance.usableItems[mid].inventoryID); Player.OnMedicalItemDequipped(ev); } } catch (Exception e) { Exiled.API.Features.Log.Error($"{typeof(DequippedMedicalItem).FullName}:\n{e}"); } }
/// <summary> /// Called after a player dequipped a medical item. /// </summary> /// <param name="ev">The <see cref="DequippedMedicalItemEventArgs"/> instance.</param> public static void OnMedicalItemDequipped(DequippedMedicalItemEventArgs ev) => MedicalItemDequipped.InvokeSafely(ev);