Penal code
The Eleven Police MDT penal code for FiveM lives in your database: chapters and charges, favorites, editing in the tablet and loading it all from a CSV.
Where it lives
The legal catalogue lives in your database, not in a file. You edit it from the tablet (the Legal section) without restarting anything, and no update touches it.
What ships with the install
An example penal code: two chapters and six generic articles, so you can see its shape. Edit or delete them from the tablet. The example is only seeded when the chapters table is empty, so it never overwrites a running server.
Until there are articles you cannot fine anyone or file charges.
How it is organised
Scope → Chapter → Article
- Scope (
scope):administrativa(minor offences) ordelito(crimes with prison time). No others can be added. The fine screen shows them in two tabs. - Chapter: the grouping ("Traffic offences"). It has a name, short name, description and order.
- Article: the specific offence.
| Article field | What it is |
|---|---|
| Name | How it appears in search and on the fine |
| Description | The legal text |
| Amount | The base that mitigating and aggravating factors apply to |
| Prison | Months. Recorded on the fine |
| Points | Licence points removed |
| Traffic | Marks it as a traffic offence |
| Type | Severity 0/1/2, minor offences only |
Permissions: legal.view to read it, legal.create, legal.edit and legal.delete to maintain it.
Favourites
Each officer stars their frequent articles and gets them first when fining. They are personal. The first time an officer opens Legal, the most used articles of each scope are starred for them (Config.FavoritosPorDefecto = { porAmbito = 10 }; 0 turns it off).
Deleting
An article charged in an incident cannot be deleted, so an old report never points to nothing. If it no longer exists in your rules, edit it instead. Deleting a chapter does take its articles with it.
Loading it from a CSV
Export your spreadsheet to CSV, put it in the resource's penalcode/ folder and type in the server console:
police-penalcode-import my-penal-code.csv
On its own it writes nothing: it tells you how many articles would go in, how many already exist and which lines it rejects and why. When it looks right:
police-penalcode-import my-penal-code.csv confirmar
The format is in penalcode/ejemplo.csv:
| Column | What it is |
|---|---|
scope | administrativa or delito |
capitulo | Parent chapter. Created if it does not exist |
nombre | Article name |
precio | Base fine |
carcel | Prison months |
puntos | Licence points |
descripcion | Legal text |
trafico | 1 for a traffic offence |
tipo | Severity 0/1/2, minor offences only |
scope,capitulo,nombre,precio,carcel,puntos,descripcion,trafico,tipo
administrativa,Traffic offences,Speeding,250,0,2,Exceeding the posted speed limit.,1,0
Tip
The importer never deletes and can be run again: it only adds what is missing, matching by scope and name. English headers work too (chapter, name, price, prison, points, description, traffic, type), as do the ; separator and descriptions with commas and quotes.
You can also insert rows through SQL: the tablet reads the database on every query. See Database.