Configuration

4 min readUpdated 2 weeks ago

Overview

  • config.lua: detection overrides, item images, waypoints, shared UI theme and Admin Hub
  • config_server.lua: admin permissions and FiveManage

Leave the detection values on 'auto' unless two resources of the same kind run on your server.

Detection

config.lua
1Config.Debug = false
2Config.Framework = 'auto'
3Config.Inventory = 'auto'
4Config.Target = 'auto'
5Config.Notify = 'auto'
6Config.Dispatch = 'auto'
7Config.ProgressBar = 'auto'
8Config.Fuel = 'auto'
9Config.Input = 'auto'
10Config.Menu = 'auto'
11Config.HelpText = 'auto'
12Config.VehicleKeys = 'auto'
13Config.Clothing = 'auto'
14Config.Weather = 'auto'
  • Debug: prints detection details and internal logs
  • Every other value: 'auto' uses the first started resource of that kind. A provider name forces it, for example Config.Inventory = 'ox' or Config.Target = 'qb'
  • Weather: 'mirror' reads hour and weather from a connected client, for weather scripts with no server API

Item Images

config.lua
1Config.InventoryImagePath = nil
2Config.InventoryImageExt = nil
  • InventoryImagePath: folder of the item images. nil uses the folder of the detected inventory
  • InventoryImageExt: image extension. nil detects it, .png when unknown

Logs

config.lua
1Config.LogBatchInterval = 60000
  • LogBatchInterval: milliseconds between two batches of Discord logs. Batching keeps webhooks under Discord rate limits
config_server.lua
1Config.FiveManageToken = ''
2Config.FiveManageDataset = 'default'
  • FiveManageToken: FiveManage API key
  • FiveManageDataset: FiveManage dataset

Logs go to Discord by default. To change the destination, add this line to config_server.lua:

config_server.lua
1Config.LogProvider = 'discord'
  • 'discord': Discord webhooks
  • 'ox_lib': ox_lib logger
  • 'fivemanage': FiveManage
  • 'both': Discord and FiveManage
  • 'all': Discord, ox_lib and FiveManage
Disable a Log

In the webhook config of any ML script, set a webhook to false to skip that log.

Admin Permissions

config_server.lua
1Config.AdminPermissions = { 'admin', 'god', 'superadmin' }
  • AdminPermissions: groups and ACE permissions treated as admin by every ML script

Shared UI Theme

config.lua
1Config.UITheme = {
2    preset = nil,
3    colors = {
4        primary = nil,
5        accent = nil,
6        background = nil,
7        surface = nil,
8        text = nil,
9    },
10}
  • preset: 'default', 'wasteland', 'cyberpunk', 'noir' or 'fantasy' for every ML panel at once. nil lets each script keep its own theme
  • colors: CSS hex values applied to every ML panel. A script can still override them in its own Config.UITheme

Admin Hub

config.lua
1Config.AdminHub = {
2    enabled = true,
3    command = 'mladmin',
4    openPermission = { 'group.admin', 'group.superadmin', 'command' },
5    lockedPanels = 'grey',
6    theme = 'default',
7    locale = 'auto',
8}
  • enabled: turns the hub on or off
  • command: opens one menu that lists the admin panels of every installed ML script
  • openPermission: who can open the hub
  • lockedPanels: panels the player has no permission for are shown greyed out ('grey') or hidden ('hide')
  • theme: hub theme
  • locale: 'auto' follows the server locale convar

Waypoints

config.lua
1Config.Waypoints = {
2    enabled = true,
3    syncToWayPoint = true,
4
5    mapWaypoint = {
6        type = 'checkpoint',
7        label = 'WAYPOINT',
8        color = '#f500fc',
9        size = 1.0,
10        drawDistance = 10000.0,
11    },
12
13    defaults = {
14        drawDistance = 10000.0,
15        fadeDistance = 400.0,
16        size = 1.0,
17        minHeight = 0.5,
18        maxHeight = 50.0,
19        groundZOffset = -2.0,
20        color = '#f5a623',
21        label = 'CHECKPOINT',
22        displayDistance = true,
23    },
24
25    dui = {
26        width = 512,
27        height = 1024,
28    },
29
30    rendering = {
31        updateInterval = 100,
32        distanceUpdateInterval = 100,
33        perspectiveDivisor = 20.0,
34        checkpointBaseMultiplier = 4.0,
35        checkpointMinScale = 0.1,
36        checkpointAspectRatio = 2.0,
37        smallMinScale = 1.0,
38        smallAspectRatio = 2.0,
39        spriteFovFactor = 0.5,
40    },
41
42    server = {
43        cleanupInterval = 60000,
44    },
45}
  • enabled: turns the 3D waypoints on or off
  • syncToWayPoint: places a 3D marker on the waypoint the player sets on the GTA map
  • mapWaypoint: look of that map marker
  • defaults: values used when a waypoint does not set them
  • dui: texture size. Higher values give sharper text and use more video memory
  • rendering: draw loop timing in milliseconds and marker scaling. Raise spriteFovFactor if markers look too small, lower it if they look too large
  • server.cleanupInterval: milliseconds between two cleanups of waypoints owned by players who left

The Waypoints page lists every waypoint field and export.