luckyscripts.DOCUMENTATION
LuckyScripts / Pulsar DispatchFIVEM FIELD GUIDE

Architecture & performance

Architecture & performance guide for LuckyScripts Pulsar Dispatch.

┌─────────────────────────────────────────────┐
│                  SERVER                      │
│  ServerState (RAM Cache)                     │
│  ├── dispatches[]   (active/solved/expired)  │
│  ├── units{}        (key: tostring(source))  │
│  └── panelOpenSources{}  (batch optimization)│
│                                              │
│  Bridge Pattern: qbx.lua / qb.lua / esx.lua │
│  Periodic Tasks: cleanup + batch broadcast   │
└─────────────────────────────────────────────┘
           │                    ▲
           │ TriggerClientEvent │ TriggerServerEvent
           ▼                    │
┌─────────────────────────────────────────────┐
│                  CLIENT                      │
│  DispatchState (NUI message relay)           │
│  ├── Alert Detectors (game events/polling)  │
│  ├── NUI Callbacks (setWaypoint, etc.)      │
│  └── Periodic Location Updates (5s)         │
└─────────────────────────────────────────────┘
           │                    ▲
           │ SendNUIMessage      │ fetch POST
           ▼                    │
┌─────────────────────────────────────────────┐
│               NUI (React 19)                 │
│  Index.tsx — Main Dispatch Panel            │
│  ├── IncidentPanel — Active calls list      │
│  ├── DispatchMap — Leaflet map              │
│  │   ├── Unit Markers (batch remount)       │
│  │   └── Alert Markers (stable popups)      │
│  ├── UnitTable — Status board               │
│  └── AlertsContainer — Pop-up alerts        │
└─────────────────────────────────────────────┘

Performance

MetricValue
Server StateRAM-only, no database queries
Unit LookupO(1) via table key
Batch Interval2 seconds
Batch TargetOnly clients with open panels (panel-state-aware)
Location Update Interval5 seconds (client → server)
Stale Unit Cleanup2 minutes of inactivity
Dispatch Expiry5 minutes (auto-expired)
Max Historical Dispatches100 (older purged)
UI Bundle Size~415 KB JS + ~50 KB CSS (gzipped: ~123 KB + ~14 KB)
Build Time~2.7 seconds

Event Frequency (50 online, 10 panels open)

EventPer 2 Seconds
setUnits (batch)10 (only open panels)
unitLocationUpdate10 (every 5s, staggered)
Total events/sec~7.5

LuckyScripts Pulsar Dispatch · Match configuration examples to your downloaded release.
Need a hand? Read the support guide ↗

On this page