public void OnEscapingPocketDimension(PocketDimensionLeaveEventArgs ev) { if (ev.Player.RoleType != RoleType.Scp106) { return; } if (_plugin.LockdownService.LockedDownScps.TryGetValue(RoleType.Scp106, out bool locked) && locked) { ev.Allow = false; ev.Player.SendToPocketDimension(); } }
internal void InvokePocketDimensionLeaveEvent(Player player, ref UnityEngine.Vector3 pos, ref PocketDimensionTeleport.PDTeleportType teleportType, out bool allow) { var ev = new PocketDimensionLeaveEventArgs { ExitPosition = pos, Player = player, TeleportType = teleportType }; PocketDimensionLeaveEvent?.Invoke(ev); pos = ev.ExitPosition; teleportType = ev.TeleportType; allow = ev.Allow; }