Opening the menu
Run/ptmenu in-game. The server checks your admin status before the menu opens — non-admins get a “You do not have permission to use this.” toast and nothing else. See Configuration → Admin access for the ways to qualify.
The menu shows the current state (active or inactive), the player count, the enable/disable flow, and the restriction toggles. Close it with the close button or Escape.
Enabling peacetime
- Pick a duration — one of the preset chips (
15m,30m,1h,2h,∞) or Custom, which takes any number of seconds, minutes, or hours. - Optionally type a Reason. It’s broadcast to every player when peacetime starts and shown on the HUD indicator.
- Click Enable peacetime.
Indefinite for the ∞ preset).
Ending peacetime
- Manually — open
/ptmenuand click Disable peacetime. - Automatically — when the chosen duration elapses, the server ends peacetime on its own. The auto-end check runs on the server clock every two seconds, so expiry lands within a couple of seconds of the scheduled time.
Config.UI.indicator.showWhenDisabled = true).
Restrictions
The menu lists seven toggles. Changes save live — flip a toggle and it applies to every connected player instantly, whether peacetime is currently active or not (inactive changes take effect the next time peacetime starts).| Restriction | What it blocks |
|---|---|
| Firing | Shooting any weapon (also disables player firing at the game level) |
| Aiming | Aiming down sights |
| Weapon swap | The weapon wheel and quick weapon-select keys |
| Melee | Melee attacks (punches, kicks, melee weapon swings) |
| Vehicle weapons | Firing from or with vehicles, including turrets and drive-bys |
| Throwables | Throwing grenades, molotovs, and other projectiles |
| Detonation | Detonating planted explosives |
Quick presets
Three preset buttons apply a full restriction set with one click:- Full — everything blocked.
- Light — firing, aiming, vehicle weapons, throwables, and detonation blocked; weapon swap and melee allowed.
- Off — nothing blocked.
Config.RestrictionPresets, so you can rename them or add your own.
What players see
- A toast notification when peacetime starts (“Peacetime Active”) and ends (“Peacetime Ended”). The wording lives in
locales/en.jsonundernotify. - A HUD indicator while peacetime is active, showing the status, a subtitle, the reason (if one was set), and the remaining time. Position and animation come from
Config.UI.indicator.
For developers
The server keeps all state in OneSync GlobalState, so other resources can read it directly:| Key | Value |
|---|---|
GlobalState.peacetime | true while peacetime is active |
GlobalState.peacetimeRestrictions | Table of the seven restriction booleans |
GlobalState.peacetimeStartedAt | Server epoch time peacetime started, or nil |
GlobalState.peacetimeEndsAt | Server epoch time it auto-ends, or nil when indefinite |
GlobalState.peacetimeReason | The broadcast reason string, or nil |
if GlobalState.peacetime then return end. The script exposes no exports — GlobalState is the supported read surface.
