v1.0.88 función
Creation permissions and a new update checker
4cambios

Creation permissions and a new update checker
4cambios

[02] Versión
Decide who may create tracks, races and competitions: everyone, admins only, or the jobs and grades you choose. Plus a new update checker that tells you in the console when a new version is out and what changed.
Nothing to do in the database.
custom/server.lua changed, and the race now depends on it. It holds the new permission check. If you edited it, copy your changes into the new file rather than keeping the old one: with the old file, creating a track or a race fails.
custom/esx/server.lua and custom/qb/server.lua gained getJob. If you edited your bridge, add that function to it. It is only used once job permissions are turned on.
After replacing the files, run refresh before ensure qs-advancedracing (or restart the server). The resource's file list changed, and a plain restart keeps the old one.
Creation permissions ship switched off, so everyone can still create, as before. To limit it, add this block to shared/config.lua (it is in the new file) and turn it on:
Config.CreationPermissions = {
enabled = true, -- only admins and the jobs below can create
jobs = {
['mechanic'] = 0, -- any grade
['racing'] = 2, -- grade 2 or higher
},
}
Admins can always create, and automated competitions are not affected. If you keep your old config.lua without the block, everyone can create.
If you use your own language file, the new message notify.no_create_permission falls back to English until you add it.
Replace every file in the resource. In shared/config.lua, only the Config.CreationPermissions block is new. In custom/, merge your own edits into the new files.
Config.CreationPermissions limits creating to admins and the jobs you list, each with a minimum grade. It ships switched off, so nothing changes until you turn it on.
On the tablet and in the phone's Racing app. The server checks every creation as well, so it cannot be bypassed.
"You are not allowed to create tracks, races or competitions", shown to a player who tries without permission.
On start, the console shows your version against the latest one. When a new version is out, it lists its type, urgency and changes, with a link to the full changelog. It replaces the old check, which had stopped running.