Three files hold everything you can change: shared/config.lua for behaviour, data/tasks.lua for the community service zone and its tasks, and data/jail.lua for the cells. Restart the resource after editing any of them.
General
| Option | Type | Default | What it does |
|---|---|---|---|
debug | boolean | false | Prints debug messages in the console. The convar set cuxial_cmservices_debug 1 turns them on too. |
ui.accent | string | configurable | Accent colour of the interface, as a hex code. |
admin.permission | string | 'mod' | Bridge permission checked for the commands and the panel. On ESX it is the player's group; 'admin' also lets superadmin in. |
admin.reasonMax | number | 250 | Maximum length of a reason, in characters. |
Commands · commands
Each command has a name (what players type, without /) and a restricted ACE group. Set restricted to the group of your staff.
| Key | Default name | Default ACE | What it does |
|---|---|---|---|
panel | sanciones | group.mod | Opens the sanctions panel. |
comserv | comserv | group.mod | Gives community service. |
endComserv | endcomserv | group.mod | Removes community service. |
jail | jaila | group.mod | Sends a player to administrative jail. |
endJail | endjail | group.mod | Releases a player from jail. |
taskCoords | taskcoords | group.mod | Task mapping tool. |
Community service · comserv
| Option | Type | Default | What it does |
|---|---|---|---|
maxTasks | number | 1000 | Most tasks per sanction from commands and the panel. |
maxApiTasks | number | 10000 | Most tasks that one AddCommunityService call can add. |
exit | vector3 | example | Where the player appears when the sanction is served or removed. |
taskRadius | number | 4.0 | Horizontal distance in metres to the centre of the task that the server accepts, plus a 1.5 m margin. |
taskHeight | number | 4.0 | Maximum height difference in metres with the task. |
interactDistance | number | 1.5 | Distance in metres from the edge of the object at which the E prompt appears, on any side. |
interactMaxReach | number | 2.2 | Largest radius in metres counted as the size of the object. Keeps the prompt close on very large objects. |
interactKey | number | 38 | Control that starts the task. 38 is E. |
minDurationRatio | number | 0.8 | Share of the task duration (0 to 1) that must pass before the server accepts it as done. |
zoneDebug | boolean | false | Draws the walls of the zone. Use it only while adjusting the polygon. |
disableControls | number[] | { 24, 25 } | Controls blocked inside the zone. 24 shoot, 25 aim. |
restoreStamina | boolean | true | Refills stamina inside the zone. |
marker | table | see below | Marker above the task object: type, scale, height above the object, color (RGBA) and drawDistance in metres. |
outline | table | enabled = true | Outlines the task object. enabled (true / false) and color (RGBA). |
blip | table | sprite = 1, scale = 0.8, route = true | Map blip of the task. route = true draws the GPS route. |
interactIcon | string | 'hammer' | Icon of the E prompt, a Font Awesome name without prefix. |
The default marker is type = 2, scale = 0.35, height = 0.5, drawDistance = 40.0.
The E prompt shows at interactDistance from the edge of the object, while the server measures taskRadius + 1.5 m from the centre of the task. Keep the prompt inside the distance the server accepts: if you raise interactDistance or interactMaxReach, raise taskRadius too.
Jail · jail
| Option | Type | Default | What it does |
|---|---|---|---|
maxMinutes | number | 1440 | Most minutes per sanction. Applies to commands, the panel and AddJail. |
exit | vector3 | example | Where the player appears when the time is served or removed. |
distance | number | 50.0 | Radius in metres around the cell. Further away, the player is brought back. |
tick | number | 60 | Seconds per minute served. 60 is real time; lower values make jail shorter. |
invincible | boolean | true | The player cannot be hurt while in jail. |
unarmed | boolean | true | Removes the weapon from the player's hand. |
disableControls | number[] | { 24, 25 } | Controls blocked in jail. |
Server checks and limits
| Option | Type | Default | What it does |
|---|---|---|---|
guard.enabled | boolean | true | The server checks the position of sanctioned players and brings back anyone outside the zone or too far from the cell. |
guard.interval | number | 5000 | Milliseconds between checks. Minimum 1000. |
distance.hz | number | 4 | Updates per second of the distance shown on screen. Maximum 4. |
distance.step | number | 1.0 | Minimum change in metres before the distance on screen updates. |
limits.task | table | { 4, 10000 } | Task requests allowed per player: { calls, window in ms }. |
limits.state | table | { 6, 10000 } | State requests allowed per player. |
limits.admin | table | { 30, 10000 } | Panel requests allowed per staff member. |
Chat and logs
| Option | Type | Default | What it does |
|---|---|---|---|
chat.enabled | boolean | true | Announces sanctions given and served in Cuxial Chat. |
chat.resource | string | 'cuxial_chat' | Name of the chat resource. |
chat.channel | string | 'sancion' | Channel id of Cuxial Chat for the announcements. |
chat.color | string | '#f59e0b' | Colour of the tag on the message. |
logs.enabled | boolean | true | Sends Discord logs when the webhook convar is set. |
logs.convar | string | 'cuxial_cmservices_webhook' | Name of the convar that holds the webhook URL. |
Work zone and tasks · data/tasks.lua
Zone · zone
| Field | Type | What it does |
|---|---|---|
entry | vector3 | Where the player appears when the sanction starts, and where they are sent back if they leave. |
points | vector3[] | Corners of the polygon around the work area, in order. At least three. |
thickness | number | Height of the polygon in metres. |
Keep entry and every task inside the polygon.
Categories · types
The five categories are fixed: construction, gardening, cleaning, maintenance and repairs. Each one has a blip and route color (GTA colour id) and an icon for the on-screen panel.
Tasks · zones
zones holds one list of tasks per category. A task is picked at random among the categories that have at least one. A category with an empty list is skipped.
repairs = {
{
coords = vec3(1655.45, 2531.67, 44.38),
name = 'zone_repairs_light_pole_a',
object = { model = 2135655372, coords = vec3(1655.45, 2531.67, 44.38) },
progress = {
label = 'progress_repairing_light_pole',
duration = 9000,
anim = { dict = 'mini@repair', clip = 'fixing_a_ped' },
},
},
},| Field | Type | What it does |
|---|---|---|
coords | vector3 | Centre of the task. The blip and the server distance check use it. |
name | string | Translation key of the task name, shown on screen and in the prompt. |
object | table | Optional. model (hash) and coords of the world object to outline. The prompt is measured from its edge. |
progress.label | string | Translation key of the progress bar text. |
progress.duration | number | Duration in milliseconds. |
progress.anim | table | Optional. dict, clip and flag (49 by default). |
progress.prop | table | Optional. Prop in hand: model, bone (60309 by default), pos and rot. |
scenario | string | Optional. A GTA scenario played instead of anim. |
Use the same position in coords and object.coords. The fastest way to get both is /taskcoords, which copies a full entry ready to paste (see Commands & permissions).
Add the name and progress.label keys to locales/en.json and locales/es.json:
"zone_repairs_light_pole_a": "Repairs - Light Pole A",
"progress_repairing_light_pole": "Repairing light pole..."Cells · data/jail.lua
cells is a list of positions. Each sanctioned player gets one at random.
return {
cells = {
vec3(1685.75, 2443.50, 45.84),
vec3(1678.60, 2443.34, 45.84),
},
}Common changes
Move the community service zone
- Run
/taskcoordsand copy the ground position of each corner of the new area. - Replace
zone.pointsandzone.entryindata/tasks.lua. - Set
comserv.zoneDebug = true, restart and walk the walls. Set it back tofalsewhen the polygon is right.
Make jail shorter
Lower jail.tick. With 30, each minute of the sanction is served in 30 seconds.
Use your staff group
Set admin.permission to the bridge permission of your staff and restricted of each command to their ACE group.
