Skip to content

Configuration

Every option of Cuxial Community Service: shared/config.lua, the tasks and work zone in data/tasks.lua, and the cells in data/jail.lua.

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 ​

OptionTypeDefaultWhat it does
debugbooleanfalsePrints debug messages in the console. The convar set cuxial_cmservices_debug 1 turns them on too.
ui.accentstringconfigurableAccent colour of the interface, as a hex code.
admin.permissionstring'mod'Bridge permission checked for the commands and the panel. On ESX it is the player's group; 'admin' also lets superadmin in.
admin.reasonMaxnumber250Maximum 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.

KeyDefault nameDefault ACEWhat it does
panelsancionesgroup.modOpens the sanctions panel.
comservcomservgroup.modGives community service.
endComservendcomservgroup.modRemoves community service.
jailjailagroup.modSends a player to administrative jail.
endJailendjailgroup.modReleases a player from jail.
taskCoordstaskcoordsgroup.modTask mapping tool.

Community service · comserv ​

OptionTypeDefaultWhat it does
maxTasksnumber1000Most tasks per sanction from commands and the panel.
maxApiTasksnumber10000Most tasks that one AddCommunityService call can add.
exitvector3exampleWhere the player appears when the sanction is served or removed.
taskRadiusnumber4.0Horizontal distance in metres to the centre of the task that the server accepts, plus a 1.5 m margin.
taskHeightnumber4.0Maximum height difference in metres with the task.
interactDistancenumber1.5Distance in metres from the edge of the object at which the E prompt appears, on any side.
interactMaxReachnumber2.2Largest radius in metres counted as the size of the object. Keeps the prompt close on very large objects.
interactKeynumber38Control that starts the task. 38 is E.
minDurationRationumber0.8Share of the task duration (0 to 1) that must pass before the server accepts it as done.
zoneDebugbooleanfalseDraws the walls of the zone. Use it only while adjusting the polygon.
disableControlsnumber[]{ 24, 25 }Controls blocked inside the zone. 24 shoot, 25 aim.
restoreStaminabooleantrueRefills stamina inside the zone.
markertablesee belowMarker above the task object: type, scale, height above the object, color (RGBA) and drawDistance in metres.
outlinetableenabled = trueOutlines the task object. enabled (true / false) and color (RGBA).
bliptablesprite = 1, scale = 0.8, route = trueMap blip of the task. route = true draws the GPS route.
interactIconstring'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 ​

OptionTypeDefaultWhat it does
maxMinutesnumber1440Most minutes per sanction. Applies to commands, the panel and AddJail.
exitvector3exampleWhere the player appears when the time is served or removed.
distancenumber50.0Radius in metres around the cell. Further away, the player is brought back.
ticknumber60Seconds per minute served. 60 is real time; lower values make jail shorter.
invinciblebooleantrueThe player cannot be hurt while in jail.
unarmedbooleantrueRemoves the weapon from the player's hand.
disableControlsnumber[]{ 24, 25 }Controls blocked in jail.

Server checks and limits ​

OptionTypeDefaultWhat it does
guard.enabledbooleantrueThe server checks the position of sanctioned players and brings back anyone outside the zone or too far from the cell.
guard.intervalnumber5000Milliseconds between checks. Minimum 1000.
distance.hznumber4Updates per second of the distance shown on screen. Maximum 4.
distance.stepnumber1.0Minimum change in metres before the distance on screen updates.
limits.tasktable{ 4, 10000 }Task requests allowed per player: { calls, window in ms }.
limits.statetable{ 6, 10000 }State requests allowed per player.
limits.admintable{ 30, 10000 }Panel requests allowed per staff member.

Chat and logs ​

OptionTypeDefaultWhat it does
chat.enabledbooleantrueAnnounces sanctions given and served in Cuxial Chat.
chat.resourcestring'cuxial_chat'Name of the chat resource.
chat.channelstring'sancion'Channel id of Cuxial Chat for the announcements.
chat.colorstring'#f59e0b'Colour of the tag on the message.
logs.enabledbooleantrueSends Discord logs when the webhook convar is set.
logs.convarstring'cuxial_cmservices_webhook'Name of the convar that holds the webhook URL.

Work zone and tasks · data/tasks.lua ​

Zone · zone ​

FieldTypeWhat it does
entryvector3Where the player appears when the sanction starts, and where they are sent back if they leave.
pointsvector3[]Corners of the polygon around the work area, in order. At least three.
thicknessnumberHeight 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.

data/tasks.lua
lua
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' },
        },
    },
},
FieldTypeWhat it does
coordsvector3Centre of the task. The blip and the server distance check use it.
namestringTranslation key of the task name, shown on screen and in the prompt.
objecttableOptional. model (hash) and coords of the world object to outline. The prompt is measured from its edge.
progress.labelstringTranslation key of the progress bar text.
progress.durationnumberDuration in milliseconds.
progress.animtableOptional. dict, clip and flag (49 by default).
progress.proptableOptional. Prop in hand: model, bone (60309 by default), pos and rot.
scenariostringOptional. 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:

locales/en.json
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.

data/jail.lua
lua
return {
    cells = {
        vec3(1685.75, 2443.50, 45.84),
        vec3(1678.60, 2443.34, 45.84),
    },
}

Common changes ​

Move the community service zone ​

  1. Run /taskcoords and copy the ground position of each corner of the new area.
  2. Replace zone.points and zone.entry in data/tasks.lua.
  3. Set comserv.zoneDebug = true, restart and walk the walls. Set it back to false when 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.

© Cuxial