Cuxial Announcements is adjusted in two places: shared/config.lua for the commands and timings, and the in-game panel for the look of each job's announcements.
Config file
Restart the resource after any change.
| Option | Type | Default | What it does |
|---|---|---|---|
command | string | 'anuncio' | Name of the command players use to send an announcement. |
adminCommand | string | 'crearanuncio' | Name of the command that opens the style panel. |
adminPermission | string | 'admin' | Permission needed to open the panel and to create, edit or delete styles. See Commands & permissions. |
cooldown | number | 30 | Seconds a player must wait between two announcements. 0 removes the wait. |
duration | number | 15000 | Default time each announcement stays on screen, in milliseconds. A style that sets its own duration uses that one instead. |
accentColor | string (hex) | configurable | Accent colour of the style panel. It does not change the announcements. |
Example
Rename the commands and allow one announcement per minute:
return {
command = 'announce',
adminCommand = 'announcestyles',
adminPermission = 'admin',
cooldown = 60,
duration = 15000,
accentColor = '#e53935',
}Announcement styles
Styles are not in a file. Staff create them in game with the panel command, and they are stored in the database table cuxial_anuncios. A change applies to the next announcement; no restart is needed.
There is one style per job. Saving a new style for a job that already has one replaces it.
General
| Field | What it is |
|---|---|
| Title | Text shown as the heading of the announcement. Required. Up to 100 characters. |
| Job | Internal name of the job, for example police. Required. It must match the job name of your framework exactly, not its label. Up to 50 characters. |
| Logo image | A file name or a full http(s) URL. |
| Logo layer, size and position | Where the logo sits: inside the template, in front of the card or behind it; its size and offset. |
| Background image | A file name or a full http(s) URL, with its opacity. |
| Colours | Title colour, title background, text colour and background colour. |
Design
| Field | What it is |
|---|---|
| Template | One of 11 layouts for the card. |
| Screen position | One of 8 anchors: the four corners, top centre, bottom centre, centre left and centre right. |
| Animation | One of 16 entry animations. |
| Logo mask | Shape that crops the logo: circle, hexagon, star and others. |
| Font | The template font or one of 8 alternatives. |
| Sound and volume | A file name or a full http(s) URL, and a volume from 0 to 100. Empty plays the default sound. |
| Effects | Background gradient, animated border, shimmer, accent line, diagonal stripes and glow. Each one is switched on separately and has its own colour and settings. |
Using your own images and sounds
A value that starts with http:// or https:// is loaded as a URL. Anything else is treated as a file name inside the resource:
| Field | Folder |
|---|---|
| Logo image | web/build/images/icons/ |
| Background image | web/build/images/background/ |
| Sound | web/build/sounds/ |
The package includes the background background.jpg and the default sound anuncio.ogg. Create the web/build/images/icons/ folder for your logos if it is not there. After adding files, restart the resource so players download them.
Updating the script replaces the resource folder. Keep a copy of the images and sounds you added and put them back after each update. Styles are safe: they live in the database.
