Skip to main content

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

  1. Pick a duration — one of the preset chips (15m, 30m, 1h, 2h, ) or Custom, which takes any number of seconds, minutes, or hours.
  2. Optionally type a Reason. It’s broadcast to every player when peacetime starts and shown on the HUD indicator.
  3. Click Enable peacetime.
Every player immediately gets a “Peacetime Active” toast, and the HUD indicator appears with a live countdown (or Indefinite for the preset).

Ending peacetime

  • Manually — open /ptmenu and 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.
Either way, all players get a “Peacetime Ended” toast and the indicator disappears (unless you set 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).
RestrictionWhat it blocks
FiringShooting any weapon (also disables player firing at the game level)
AimingAiming down sights
Weapon swapThe weapon wheel and quick weapon-select keys
MeleeMelee attacks (punches, kicks, melee weapon swings)
Vehicle weaponsFiring from or with vehicles, including turrets and drive-bys
ThrowablesThrowing grenades, molotovs, and other projectiles
DetonationDetonating planted explosives
The exact control IDs behind each category are configurable — see Configuration → Control groups.

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.
Presets are defined in 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.json under notify.
  • 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.
Players don’t need to do anything — restrictions are enforced automatically on their client while peacetime is active.

For developers

The server keeps all state in OneSync GlobalState, so other resources can read it directly:
KeyValue
GlobalState.peacetimetrue while peacetime is active
GlobalState.peacetimeRestrictionsTable of the seven restriction booleans
GlobalState.peacetimeStartedAtServer epoch time peacetime started, or nil
GlobalState.peacetimeEndsAtServer epoch time it auto-ends, or nil when indefinite
GlobalState.peacetimeReasonThe broadcast reason string, or nil
For example, a robbery script can bail out early with if GlobalState.peacetime then return end. The script exposes no exports — GlobalState is the supported read surface.