Skip to content

Configuration

Every option of Cuxial Announcements: the config file and the styles created in game.

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.

OptionTypeDefaultWhat it does
commandstring'anuncio'Name of the command players use to send an announcement.
adminCommandstring'crearanuncio'Name of the command that opens the style panel.
adminPermissionstring'admin'Permission needed to open the panel and to create, edit or delete styles. See Commands & permissions.
cooldownnumber30Seconds a player must wait between two announcements. 0 removes the wait.
durationnumber15000Default time each announcement stays on screen, in milliseconds. A style that sets its own duration uses that one instead.
accentColorstring (hex)configurableAccent colour of the style panel. It does not change the announcements.

Example ​

Rename the commands and allow one announcement per minute:

shared/config.lua
lua
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 ​

FieldWhat it is
TitleText shown as the heading of the announcement. Required. Up to 100 characters.
JobInternal 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 imageA file name or a full http(s) URL.
Logo layer, size and positionWhere the logo sits: inside the template, in front of the card or behind it; its size and offset.
Background imageA file name or a full http(s) URL, with its opacity.
ColoursTitle colour, title background, text colour and background colour.

Design ​

FieldWhat it is
TemplateOne of 11 layouts for the card.
Screen positionOne of 8 anchors: the four corners, top centre, bottom centre, centre left and centre right.
AnimationOne of 16 entry animations.
Logo maskShape that crops the logo: circle, hexagon, star and others.
FontThe template font or one of 8 alternatives.
Sound and volumeA file name or a full http(s) URL, and a volume from 0 to 100. Empty plays the default sound.
EffectsBackground 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:

FieldFolder
Logo imageweb/build/images/icons/
Background imageweb/build/images/background/
Soundweb/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.

© Cuxial