Emergency / Service
Full emergency services system with SOS button, service dispatch (Police, Firefighter, Mechanic, Paramedic), real-time request tracking, responder notifications, and GPS blip integration.
Features
- SOS button — sends simultaneous alerts to Police and Paramedic
- 4 service types: Police, Firefighter, Mechanic, Paramedic
- Configurable job names per framework (ESX, QBCore, Creative, Standalone)
- Share GPS location with responder (optional toggle)
- When one responder accepts, ringing stops for all others
- GPS blip on map when responder accepts the call
- Full request history per player
- Responder view — see all pending calls for your job
- Server-side request management with auto-cleanup on disconnect
Services
| Service | Default Job | Blip Color | Blip Sprite |
|---|---|---|---|
| Police | police | Blue (3) | 137 |
| Firefighter | firefighter | Red (1) | 485 |
| Mechanic | mechanic | Orange (5) | 446 |
| Paramedic | paramedic | Green (1) | 61 |
SOS Button
The SOS button is a large, prominent button on the home screen. When pressed, it sends simultaneous emergency requests to Police and Paramedic services with GPS location sharing enabled. A 10-second cooldown prevents spam.
Responder Flow
When a player with the matching job receives a request, the NUI event emergency:receiveRequest fires. The responder can accept or decline. When one responder accepts:
- The caller receives a notification with the responder's name
- All other responders for that service are notified the request was taken
- A GPS blip appears on the caller's map showing the responder's approach
- The request status updates from 'pending' to 'accepted'
Configuration
Service job names are configured server-side in server/apps/emergency.lua. The system automatically detects your framework (ESX, QBCore, Creative, Standalone) and reads player job data accordingly.
local SERVICE_CONFIG = {
police = { label = "Policia", job = "police", blipColor = 3, blipSprite = 137 },
fire = { label = "Bombeiro", job = "firefighter", blipColor = 1, blipSprite = 485 },
mechanic = { label = "Mecanico", job = "mechanic", blipColor = 5, blipSprite = 446 },
paramedic = { label = "Paramedico", job = "paramedic", blipColor = 1, blipSprite = 61 },
}To add a new service, add an entry to the SERVICE_CONFIG table and ensure your framework's job registration matches the job field.