public void OnGeneratorAccess(ref GeneratorUnlockEvent ev) { if (SCP_ROLES.Contains(ev.Player.GetRole())) { return; } if (ev.Allow) { return; } ev.Allow = hasPermission(ev.Player, "ARMORY_LVL_2"); }
internal static void InvokeGeneratorUnlock(Player player, Generator079 generator, ref bool allow) { if (GeneratorUnlockEvent == null) { return; } var ev = new GeneratorEvent { Allow = allow, Generator = generator, Player = player }; GeneratorUnlockEvent.Invoke(ev); allow = ev.Allow; }
public void OnGeneratorUnlock(GeneratorUnlockEvent ev) { if (Dump.PlayerLock.Contains(ev.Player.UserId)) { ev.Allow = false; return; } if (!Core.RemoteCard) { return; } foreach (Inventory.SyncItemInfo itemInfo in ev.Player.Hub.inventory.items) { if (ev.Player.Hub.inventory.GetItemByID(itemInfo.id).permissions.Contains("ARMORY_LVL_2") || ev.Player.BypassMode) { ev.Allow = false; ev.Generator.NetworkisDoorUnlocked = true; ev.Generator._doorAnimationCooldown = 0.5f; } } }
public void OnGeneratorUnlock(GeneratorUnlockEvent ev) { if (!Sitrep.Events.Contains("generatorunlockevent")) { return; } if (!Sitrep.CustomChannelIds.TryGetValue("generatorunlockevent", out ulong channel)) { channel = Sitrep.EventsId; } Room room = Map.GetRoom(ev.Generator.CurRoom); string roomName = ""; if (room != null) { roomName = room.Name; } if (string.IsNullOrEmpty(roomName)) { RoomInformation roomInformation = Map.GetRoomInformation(ev.Generator.CurRoom); if (roomInformation != null) { roomName = roomInformation.CurrentRoomType.ToString(); } } if (string.IsNullOrEmpty(roomName)) { Rid roomId = Map.GetRoomID(ev.Generator.CurRoom); if (roomId != null) { roomName = roomId.id; } } Send($":unlock: [{ev.Player.Role.AsString()}] {ev.Player.Nick.DiscordSanitize()} ({ev.Player.ParsedUserId}) odemkl generátor {(!string.IsNullOrEmpty(roomName) ? $"v {roomName}" : "")}", channel); }