BenzyPrioAOP — Events
Every net event BenzyPrioAOP registers or triggers, with its direction and payload. All of them are namespaced BenzyPrioAOP:* and are internal sync events between this resource's own server and client — they are not a stable public API, but they are documented here so you can see exactly how state moves.
The server is the single source of truth. When the AOP value, a prio's state, or peacetime changes, the server pushes the new state to clients; clients only ever ask for a resend.
Server → client
| Event | Payload | Purpose |
|---|---|---|
BenzyPrioAOP:SyncAOP | { enabled = bool, name = string } | The current Area of Patrol. Sent to one player or to -1 (everyone). |
BenzyPrioAOP:SyncPrios | { enabled = bool, prios = { … } } | Full prio state in config order. Each entry: { name, state = 'AVAILABLE'|'ACTIVE'|'COOLDOWN', count, max, cooldownRemaining }. cooldownRemaining is seconds left. |
BenzyPrioAOP:SyncPeacetime | { enabled = bool, active = bool } | Whether peacetime is on. The client starts/stops its local enforcement from this. |
BenzyPrioAOP:Banner | { title = string, subtitle = string, color = '#rrggbb' } | Shows the large on-screen banner (AOP changes, peacetime on/off). |
BenzyPrioAOP:DebugAccessResult | { { 'benzy.aop', bool }, { 'benzy.prio', bool }, { 'benzy.peacetime', bool } } | Debug only — the caller's resolved access per role, answered to the requesting client. |
Client → server
| Event | Payload | Purpose |
|---|---|---|
BenzyPrioAOP:RequestState | — | Asks the server to re-push the AOP, prio, and peacetime state to the caller. Fired when the NUI (re)initializes and covers late joiners / UI reloads. |
BenzyPrioAOP:DebugAccess | — | Debug only — asks the server for the caller's resolved staff access. Ignored unless Config.Debug is true; the answer comes back on BenzyPrioAOP:DebugAccessResult. |
Standard events consumed
BenzyPrioAOP also reacts to a few standard FiveM events: players who disconnect are removed from any prio they were in, and peacetime plus the HUD cursor clean up correctly if the resource is stopped.
Player state is keyed on the live server id (
source) only — there is no identifier persistence, so prio membership is per-session and resets if a player reconnects. This is intentional for a lightweight, standalone HUD.