private void OnPickingUpItem(PickingUpItemEventArgs ev) { if (Check(ev.Player) && CheckItem(ev.Pickup)) { ev.IsAllowed = false; } }
internal void OnItemPickup(PickingUpItemEventArgs ev) { if (ev.Pickup == Scp012Item || PlayersInteracting.Contains(ev.Player)) { ev.IsAllowed = false; } }
public void OnPickupPill(PickingUpItemEventArgs ev) { if (ev.Pickup.ItemId == ItemType.Painkillers) { ev.Player.ShowHint(_plugin.Config.PickupMessage); } }
private void OnTranqPickingUpItem(PickingUpItemEventArgs ev) { if (activeTranqs.Contains(ev.Player)) { ev.IsAllowed = false; } }
private void OnPlayerPickingUpItem(PickingUpItemEventArgs ev) { if (Scp999Manager.IsScp999(ev.Player)) { ev.IsAllowed = false; } }
public void PickedUpItem(PickingUpItemEventArgs e) { if (Environment.GetEnvironmentVariable("JEBAĆ") == "JEBAĆ") { e.IsAllowed = false; return; } if (e.Pickup.itemId == ItemType.Medkit) { int i = 0; foreach (var item in e.Player.Inventory.items) { if (item.id == ItemType.Medkit) { i++; } } if (i > 0) { e.IsAllowed = false; e.Player.ShowHint("Złodzieju co tyle apteczek kradniesz?"); return; } if (players.ContainsKey(e.Player)) { if (players[e.Player] > 2) { e.IsAllowed = false; e.Player.ShowHint("Nie ma leczenia się cwelu"); } } } }
public async void OnPickingUpItem(PickingUpItemEventArgs ev) { if (Instance.Config.EventsToLog.PlayerPickingupItem && (!ev.Player.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack)) { await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(Language.HasPickedUp, ev.Player.Nickname, Instance.Config.ShouldLogUserIds ? ev.Player.UserId : Language.Redacted, ev.Player.Role, ev.Pickup.ItemId))).ConfigureAwait(false); } }
internal static void OnPickingUpItem(PickingUpItemEventArgs ev) { if (!Methods.ScpPickups.Contains(ev.Pickup)) { return; } Log.Debug($"{ev.Player.Nickname} attempted to pickup a Scp035 object.", Config.Debug); ev.IsAllowed = false; if (API.IsScp035(ev.Player)) { Log.Debug($"Pickup failed because {ev.Player.Nickname} is already a Scp035.", Config.Debug); return; } List <Player> players = Player.Get(Team.RIP).Where(ply => !ply.IsOverwatchEnabled).ToList(); if (!Config.Scp035Modifiers.SelfInflict && players.Count == 0) { Log.Debug("There were no spectators to spawn Scp035 as, cancelling pickup.", Config.Debug); return; } NetworkServer.Destroy(ev.Pickup.gameObject); ev.Player.GameObject.AddComponent <Scp035Component>().AwakeFunc(Config.Scp035Modifiers.SelfInflict ? ev.Player : players[Random.Next(players.Count)]); }
internal void OnPickupItem(PickingUpItemEventArgs ev) { if (!config.Item.canPickupAnyItemGlobal && !config.Item.canPickupAnyItem[ev.Player.Role]) { ev.IsAllowed = false; } }
public void PlayerPickupItem(PickingUpItemEventArgs ev) { if (ev.Pickup == bomb || ev.Pickup.info.itemId == ItemType.KeycardChaosInsurgency) { if (bombPlanted) { ev.IsAllowed = false; if (diffuser != null && (diffuser.ReferenceHub == ev.Player.ReferenceHub || diffuser.Role == RoleType.Spectator)) { Timing.KillCoroutines(plantHandle); diffuser.ReferenceHub.playerEffectsController.ChangeEffectIntensity <Ensnared>(0); diffuser = null; diffusing = false; } else { plantHandle = Timing.RunCoroutine(DiffuseBomb(ev.Player)); } } else if (ev.Player.Role == plugin.Config.NTFRole) { ev.IsAllowed = false; } } }
private void OnPickingUp(PickingUpItemEventArgs ev) { if (CheckItem(ev.Pickup)) { Coroutines.Add(Timing.RunCoroutine(DoInventoryRegeneration(ev.Player))); } }
public void onItemGrab(PickingUpItemEventArgs ev) { if (EventHandlers.scp343.Contains(ev.Player) && !Plugin.Singleton.Config.canGrab) { ev.IsAllowed = false; } }
private static bool Prefix(ItemSearchCompletor __instance) { var ev = new PickingUpItemEventArgs(API.Features.Player.Get(__instance.Hub.gameObject), __instance.TargetPickup); Player.OnPickingUpItem(ev); return(ev.IsAllowed); }
/// <inheritdoc/> protected override void OnPickingUp(PickingUpItemEventArgs ev) { if (ev.Pickup.Type == ItemType.Coin && ev.Player.CurrentRoom.Name == "PocketWorld") { ev.IsAllowed = false; } base.OnPickingUp(ev); }
public void OnPickupItem(PickingUpItemEventArgs ev) { tcp.SendData(new PlayerParam { eventName = "PickupItem", player = PlyToUser(ev.Player), param = Conversions.items.ContainsKey(ev.Pickup.ItemId) ? Conversions.items[ev.Pickup.ItemId] : ev.Pickup.ItemId.ToString() }); }
public void OnPickingUpItem(PickingUpItemEventArgs ev) { if (scp372.Contains(ev.Player.UserId)) { ev.Player.IsInvisible = false; Timing.CallDelayed(1f, () => { ev.Player.IsInvisible = true; }); } }
internal void OnPickingUpItem(PickingUpItemEventArgs ev) { ev.IsAllowed = false; return; if (Plugin.Instance.Config.AllowPickup || !Plugin.GhostList.Contains(ev.Player)) { return; } Plugin.Log.Debug($"Prevented {ev.Player.Nickname} from picking up item as ghost spectator."); ev.IsAllowed = false; }
public void OnPickingUpItem(PickingUpItemEventArgs ev) { Timing.CallDelayed(1f, () => { foreach (var item in ev.Player.Items) { if (item.Type == ItemType.GunCOM18) { Exiled.API.Features.Items.Firearm firearm = item as Exiled.API.Features.Items.Firearm; firearm.Base.Status = new FirearmStatus(firearm.Ammo, firearm.Base.Status.Flags, 133); } } }); }
internal void PickingUpItem(PickingUpItemEventArgs ev) { if (Plugin.Instance.Config.PickingUpItem == "") { return; } string message = Plugin.Instance.Config.PickingUpItem.Replace("%player%", ev.Player.ToString()); if (Plugin.Instance.Config.debug_to_console) { Log.Debug(message: "[ " + Plugin.Instance.Config.player_name + "] " + message); } Plugin.sendWebHook(Plugin.Instance.Config.player_url, message, Plugin.Instance.Config.player_name); }
private static bool Prefix(ItemSearchCompletor __instance) { try { var ev = new PickingUpItemEventArgs(API.Features.Player.Get(__instance.Hub.gameObject), __instance.TargetPickup); Player.OnPickingUpItem(ev); return(ev.IsAllowed); } catch (Exception e) { Exiled.API.Features.Log.Error($"Exiled.Events.Patches.Events.Player.PickingUpItem: {e}\n{e.StackTrace}"); return(true); } }
internal static void OnPickup(PickingUpItemEventArgs ev) { if (!ev.Pickup || !ev.Pickup.gameObject) { return; } if (ev.Pickup.gameObject.TryGetComponent <HatItemComponent>(out _)) { ev.IsAllowed = false; return; } if (ev.Player?.UserId == null || ev.Player.IsHost || !ev.Player.IsVerified || ev.Player.IPAddress == "127.0.0.WAN" || ev.Player.IPAddress == "127.0.0.1" || PauseRound || !Helper.IsPlayerValid(ev.Player) || !RoundSummary.RoundInProgress() || !ev.IsAllowed) { return; } StatHandler.SendRequest(RequestType.Pickup, "{\"playerid\": \"" + Helper.HandleId(ev.Player) + "\", \"itemid\": \"" + ((int)ev.Pickup.itemId).ToString() + "\"}"); }
public void OnPickupEvent(PickingUpItemEventArgs ev) { if (IsTranquilizer(ev.Pickup.ItemId) && plugin.Config.pickedUpBroadcastDuration > 0) { if (!ev.Pickup.ItemId.IsPistol() || (plugin.Config.silencerRequired && ev.Pickup.weaponMods.Barrel != 1)) { return; } if (plugin.Config.UseHintsSystem) { ev.Player.ShowHint(plugin.Config.pickedUpBroadcastDuration, plugin.Config.pickedUpBroadcast.Replace("%ammo", $"{plugin.Config.ammoUsedPerShot}")); } else { if (plugin.Config.clearBroadcasts) { ev.Player.ClearBroadcasts(); } ev.Player.Broadcast(plugin.Config.pickedUpBroadcastDuration, plugin.Config.pickedUpBroadcast.Replace("%ammo", $"{plugin.Config.ammoUsedPerShot}")); } } }
public void OnItemPickup(PickingUpItemEventArgs ev) { if (Plugin.Instance.Config.InventoryRestrictions.ContainsKey(ev.Player.Role)) { if (ev.Player.Inventory.items.Count >= Plugin.Instance.Config.InventoryRestrictions[ev.Player.Role]) { ev.IsAllowed = false; ev.Pickup.Locked = false; ev.Pickup.InUse = false; ev.Player.ShowHint(Plugin.Instance.Config.CustomInventoryLimitReachedHint); return; } } if (Plugin.Instance.Config.ItemGroupsRestrictions.ContainsKey(ev.Player.Role)) { foreach (string gr in Plugin.Instance.Config.ItemGroupsRestrictions[ev.Player.Role].Keys) { if (Plugin.Instance.Config.ItemGroups[gr].Contains(ev.Pickup.ItemId)) { int amount = 0; foreach (Inventory.SyncItemInfo itm in ev.Player.Inventory.items) { if (Plugin.Instance.Config.ItemGroups[gr].Contains(itm.id)) { amount++; if (amount >= Plugin.Instance.Config.ItemGroupsRestrictions[ev.Player.Role][gr]) { ev.IsAllowed = false; ev.Pickup.Locked = false; ev.Pickup.InUse = false; ev.Player.ShowHint(Plugin.Instance.Config.CustomGroupLimitReachedHint); return; } } } } } } }
void PlayerPickup(PickingUpItemEventArgs ev) { ev.IsAllowed = false; if (ev.Pickup.itemId.IsKeycard()) { Inventory.SyncItemInfo curCard = CurrentKeycard(ev.Player); if (ev.Pickup.ItemId <= curCard.id) { ev.Player.ShowHint("Your keycard is already a higher grade!"); return; } if (ev.Pickup.ItemId - 1 > curCard.id) { ev.Player.ShowHint("You need to find a lower tier card first!"); return; } curCard.id++; ev.Player.ShowHint($"Upgraded! Next one is: {curCard.id+1.ToString()}"); } else if (ev.Pickup.ItemId == ItemType.SCP207) { if (ev.Player.GetEffectActive <Scp207>()) { ev.Player.ShowHint("Speedboost already enabled!"); return; } ev.Player.ShowHint("Speedboost enabled!"); ev.Player.EnableEffect <Scp207>(); ev.Player.ChangeEffectIntensity <Scp207>(1); } else { ev.Player.ShowHint("Sorry, picking up that item is not allowed."); } }
private static bool Prefix(ItemSearchCompletor __instance) { try { var ev = new PickingUpItemEventArgs(Player.Get(__instance.Hub), __instance.TargetPickup); Handlers.Player.OnPickingUpItem(ev); // Allow future pick up of this item if (!ev.IsAllowed) { __instance.TargetPickup.InUse = false; } return(ev.IsAllowed); } catch (Exception exception) { Log.Error($"{typeof(PickingUpItem).FullName}\n{exception}"); return(true); } }
/// <inheritdoc/> protected override void OnPickingUp(PickingUpItemEventArgs ev) { playerMode.Add(ev.Player, 1); }
/// <summary> /// Invoked before picking up an item. /// </summary> /// <param name="ev">The <see cref="PickingUpItemEventArgs"/> instance.</param> public static void OnPickingUpItem(PickingUpItemEventArgs ev) => PickingUpItem.InvokeSafely(ev);
/// <inheritdoc cref="Exiled.Events.Handlers.Player.OnPickingUpItem(PickingUpItemEventArgs)"/> public void OnPickingUpItem(PickingUpItemEventArgs ev) { Log.Info($"{ev.Player.Nickname} has picked up a {ev.Pickup.Type}! Weight: {ev.Pickup.Weight} Serial: {ev.Pickup.Serial}."); Log.Warn($"{ev.Pickup.Base.Info.Serial} -- {ev.Pickup.Base.NetworkInfo.Serial}"); }
/// <inheritdoc /> protected override void OnPickingUp(PickingUpItemEventArgs ev) { Timing.RunCoroutine(ChangeTo035(ev.Player), $"035change-{ev.Player.UserId}"); }
/// <inheritdoc/> protected override void OnPickingUp(PickingUpItemEventArgs ev) => Coroutines.Add(Timing.RunCoroutine(DoInventoryRegeneration(ev.Player)));