AI Core

ai-policealert

The built-in police alert system - alert cards, map blips and a waypoint key for on-duty officers.

ai-policealert shows police alerts to on-duty officers: a card on the screen, a blip on the map and a key that sets a waypoint to the newest alert. Every script that sends a police alert (robberies, shots fired, drug sales, prison escapes, street races) sends it through AI Core, and AI Core hands it to ai-policealert while it is the active alert system. You can replace it with another alert script without touching any other script.

What it does in the game

  • Alert card. A card slides in with the alert's radio code, title, extra line, street and area, and a bar that drains while the card stays. High priority alerts (armed robbery, officer down) blink red. At most four cards show at once, newest on top.
  • Blip. Each alert with a position gets a map blip for the alert time. High priority blips flash.
  • Waypoint key. Press J to set a waypoint to the newest live alert.
  • Sound. A sound plays when a card comes in (panel switch).
  • Who gets it. On-duty members of the jobs the alert names. An alert that names no jobs goes to the panel's Alert jobs.
  • Going on duty. An officer who goes on duty gets the live alerts of their job at once. Going off duty or switching character clears the cards.

Installation

Installed by the AI Core recipe. By hand: ensure ai-policealert after ensure ai-core. It needs ai-core.

In ai-core's panel, General > Police alerts picks the alert system. auto uses the first supported alert script that runs; ai-policealert comes last in that order, so an installed third-party alert script wins. Pick ai-policealert there to force it.

To test: an ai-core admin types aicore_alert (or aicore_alert high) in the game. It sends a test alert at the admin's position through the active alert system.

Panel settings

Admin panel > Police alerts > tab Alerts. These settings are used only while ai-policealert is the alert system AI Core sends alerts to. Defaults come from data/settings.json.

SettingWhat it changesUnitDefault
Alert jobsOn-duty members of these jobs get alerts that name no jobs of their own. Up to 10.police
Alert timeHow long an alert's blip and waypoint key stay, unless the alert names its own time. 10-600.s60
Card timeHow long the alert card stays on screen. 2-60.s8
Live alerts per officerMost alerts an officer keeps on the map at once; a new one replaces the oldest. 5-100.30
SoundA sound plays when a card comes in.on
Alert blipMap blip of an alert whose script sets no blip of its own. High priority alerts flash.sprite 60, colour 1 (red), size 0.8

Commands

None of its own. aicore_alert [high] (ai-core, admins only) sends a test alert.

Keybinds

Each player can change these in GTA's key settings (FiveM section); the owner changes the defaults in the admin panel (Keybinds).

Default keyWhat it does
JSet a waypoint to the newest police alert (police_alert_waypoint).

What it stands in for

No fxProvide. QBCore / Qbox scripts that send police:server:policeAlert (qb robberies, vehicle keys and others) still work: AI Core answers that event and passes the alert to the active alert system.

Other alert scripts

AI Core's dispatch layer also supports tgiann-policealert, ps-dispatch, cd_dispatch, rcore_dispatch, core_dispatch, linden_outlawalert, lb-tablet, wasabi_mdt, origen_police, kartik-mdt, tk_dispatch, codem-dispatch, aty_dispatch, redutzu-mdt, emergencydispatch, tgiann-mdt and tgiann-policejob. Install one of them and leave Police alerts on auto (or pick it), and every ai-* script's alerts go there. See Compatibility.

Known limits

  • Alerts live in memory only. After a restart of ai-policealert there is nothing to show until new alerts come in.
  • The server keeps at most 1,000 live alerts over all jobs; the oldest goes first.
  • Street and area names are read on each officer's game from the alert's position.

On this page