ai-police
Police work for on-duty officers - cuff, escort, seat, search, fine, send to prison and impound - plus duty stations and shot alerts.
ai-police gives on-duty members of your police jobs a job menu to cuff, escort, put in and take out of vehicles, search, fine, send to prison and impound. Officers go on and off duty at station points, and gunfire by civilians sends a police alert. The server checks every action.
What it does in the game
- Duty. Members of a police job see a Go on or off duty point at every station. Only on-duty officers get the police menu.
- Police menu. Press F6, or pick Police on the radial menu. The menu acts on the closest player within 3 m (the closest vehicle within 6 m for impound):
- Cuff or uncuff: the target plays a cuffed animation and most controls are blocked until uncuffed.
- Escort: a cuffed target is attached to the officer and walks with them. Pick it again to let go.
- Put in vehicle: a cuffed target sits in a back seat of the closest vehicle.
- Take out of vehicle: gets the target out again.
- Search: opens the target's inventory. The target must be cuffed or down.
- Write a fine: the officer types an amount (up to the panel's highest fine). The target gets a bill from the officer's on-duty job and a notification. A fine record goes to the police MDT when one runs.
- Send to prison: the officer types the minutes. The target must be cuffed. The prison script jails them, they are uncuffed, and an arrest record goes to the MDT.
- Impound the vehicle: the garage script takes an owned vehicle to its impound; any other vehicle is deleted.
- Shot alerts. When a player who is not police fires a weapon, a Shots fired alert goes to on-duty officers. At most one alert per 150 m area every 30 s.
- Station blips. Each station can show a map blip.
Installation
Installed by the AI Core recipe. By hand: ensure ai-police after ensure ai-core. It needs ai-core and OneSync.
- Prison: Send to prison needs a prison script (ai-prison or another one AI Core supports). Without one the officer sees "No prison is running on this server."
- Alerts: shot alerts show through the police alert script AI Core uses (ai-policealert by default).
- Make sure your police job exists in ai-core (admin panel, Jobs) and is listed in Police jobs below.
Panel settings
Admin panel > Police. Defaults come from data/settings.json and data/stations.json.
Rules tab
| Setting | What it changes | Unit | Default |
|---|---|---|---|
| Police jobs | Job names whose on-duty members act as police. Up to 10. If the list is empty, police is used. | police | |
| Highest fine | The largest fine an officer can write. Fines are bills: the target pays them later and the money goes to the job's account. 0-10,000,000. | $ | 50,000 |
| Shot alerts | Gunfire by civilians alerts on-duty officers through the alert script ai-core uses. Turn it off when that script sends its own shot alerts. | on |
Stations tab
One record per station. Defaults: Mission Row Police Department, Sandy Shores Sheriff, Paleto Bay Sheriff.
| Setting | What it changes | Default for a new station |
|---|---|---|
| Name | The station name, shown on the blip. 1-48 characters. | empty |
| Duty point | Where officers toggle duty. Stand there and use your position. | 0, 0, 0 |
| Map blip | Shows the station on the map. | on |
| Blip look | Sprite, colour and size of the blip (shown when Map blip is on). | sprite 60, colour 29, size 0.7 |
Commands
None.
Keybinds
Each player can change these in GTA's key settings (FiveM section); the owner changes the defaults in the admin panel (Keybinds).
| Default key | What it does |
|---|---|
| F6 | Open the police menu (police_menu). Works only on duty, not while cuffed or down. |
The same menu is on the radial menu as Police (shown on duty and not cuffed), whichever radial menu script runs. Duty points use ai-core's Interaction style (prompt with E, or a target option).
What it stands in for
No fxProvide. It does the work of a framework's police job script, but it does not answer another police script's exports or events.
Compatible scripts
Everything outside police work goes through AI Core, so these can be any supported script (see Compatibility):
- Fines go through AI Core's billing layer: tgiann-phone's billing app, okokBillingV3, wasabi_billing, codem-billing, esx_billing, else ai-core's own bills.
- Records go through the MDT layer: tgiann-mdt, lb-tablet, ps-mdt, wasabi_mdt (nothing is written when no MDT runs).
- Prison goes through the prison layer: ai-prison, qb-prison, rcore_prison, xt-prison, tgiann-policejob.
- Alerts go through the dispatch layer (any supported police alert script).
- Search opens the inventory through the inventory layer; impound goes through the garage layer.
Known limits
- Only online players are handled; there is no jail or fine for offline characters.
- Send to prison accepts up to 10,000 minutes; the prison script may cut it shorter (ai-prison's Longest sentence).
- Log channels:
actions(every menu action) andfines.