private static void updateDoorCracking() { secondsLeft--; if (secondsLeft == 0) { NAPI.Task.Run(() => { try { NAPI.Entity.DeleteEntity(label); NAPI.Entity.DeleteEntity(safeDrill); } catch { } }); isCracking = false; /*bankTimer = Main.StartT(600000, 99999999, (o) => { * canBeClosed = true; * Main.StopT(bankTimer, "timer_21"); * });*/ Timers.StartOnce("bankTimer", 600000, () => { canBeClosed = true; }); Doormanager.SetDoorLocked(2, true, 0.5f); //Main.StopT(timer, "timer_22"); Timers.Stop(timer); return; } int minutes = secondsLeft / 60; int seconds = 00; seconds = secondsLeft % 60; label.Text = $"~r~{minutes}:{seconds}"; }
private static void callback_safedoor(Client player, Menu menu, Menu.Item item, string eventName, dynamic data) { switch (item.ID) { case "change": MenuManager.Close(player); if (Main.Players[player].FractionID == 6 && Main.Players[player].FractionLVL >= 14) { if (isCracking) { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Невозможно сделать это сейчас", 3000); return; } if (!canBeClosed) { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Невозможно сделать это сейчас", 3000); return; } if (isOpen) { isOpen = false; Doormanager.SetDoorLocked(2, true, 0); } else { isOpen = true; Doormanager.SetDoorLocked(2, true, 45f); } string msg = "Вы закрыли дверь"; if (isOpen) { msg = "Вы открыли дверь"; } Notify.Send(player, NotifyType.Success, NotifyPosition.BottomCenter, msg, 3000); } else { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не можете сделать это", 3000); } return; case "crack": MenuManager.Close(player); startSafeDoorCracking(player); return; case "close": MenuManager.Close(player); return; } }
public static void lockCrack(Client player, string name) { NAPI.Task.Run(() => { try { if (player == null) { return; } Doormanager.SetDoorLocked(player.GetData("DOOR"), false, 0); player.FreezePosition = false; Trigger.ClientEvent(player, "hideLoader"); //Main.StopT(player.GetData("LOCK_TIMER"), "timer_20"); player.ResetData("LOCK_TIMER"); Notify.Send(player, NotifyType.Success, NotifyPosition.BottomCenter, $"Вы успешно взломали дверь", 3000); } catch { } }); }