Skip to main content

Runtime Mechanics Editor

Create and manage mechanic locations in-game

This section

Runtime Mechanics Editor

Create and place mechanic locations in-game without touching config files. All changes are saved to the database and synced live.

Access

  • Command: /mechanics — configurable via Config.MechanicsEditor.command
  • Permission required: admin level — see Permissions

Features

  • Freecam mode (F7) for precise placement
  • Gizmo controls: move, rotate, and scale radius
  • Step-by-step mechanic creation wizard
  • Configure all features per mechanic: zone, blip, lift, craft, shop, boss, storage
  • Shop & craft template system (reusable presets)
  • Live runtime sync — changes apply immediately to all players
  • Saved to code9_mechanics_runtime database table
  • Max 200 mechanic locations per server
  • Mechanic auto-detection from player's current job

Permissions

/mechanics is admin-only. The check runs server-side and the allowed groups/permissions are configurable per framework via Config.MechanicsEditor.permissions.

Defaults

LayerCheckDefault allowed
txAdmin / ACEIsPlayerAceAllowed(src, ace) — runs for each txAdmin.aces entrydisabled by default
ESXxPlayer.getGroup() — value compared against esxGroups listadmin, superadmin
QBCoreQBCore.Functions.HasPermission(src, perm) — runs for each qbPermissions entryadmin, god
QBoxQBX.Functions.HasPermission(src, perm) (fallback to exports.qbx_core:HasPermission) — runs for each qboxPermissions entryadmin, god

The txAdmin / ACE layer runs before the framework check. If it allows access, the framework check is skipped — useful when your admins aren't tied to a framework group.

Customizing the lists

Edit shared/config.lua:

lua
Config.MechanicsEditor.permissions = {
esxGroups = { 'admin', 'mod' },
qbPermissions = { 'admin', 'god', 'mod' },
qboxPermissions = { 'admin', 'god' },
txAdmin = {
enabled = true,
aces = { 'command' },
}
}

Granting access per player

txAdmin / ACE-based admins

For servers where admins are managed via txAdmin, vMenu, or any other ACE-based permission system (without using framework groups), enable the txAdmin block:

lua
Config.MechanicsEditor.permissions.txAdmin = {
enabled = true,
aces = { 'command' }, -- or a custom ACE like 'code9.mechanic'
}

Each entry is checked with IsPlayerAceAllowed(source, ace). Any match grants access — independently of the framework groups below.

ESX

Player groups live in the users.group column. Set with the built-in admin command:

/setgroup [id] admin

QBCore

Permissions are FiveM ACE permissions. Grant in server.cfg:

add_principal identifier.license:xxxxxxxxxxxxxxxx qbcore.admin

Or at runtime:

lua
QBCore.Functions.AddPermission(source, 'admin')

QBCore evaluates HasPermission against ACE entries prefixed with qbcore. (e.g. qbcore.admin, qbcore.god, qbcore.mod).

QBox

QBox uses ACE permissions. The standard pattern in server.cfg:

add_ace group.admin command allow
add_principal identifier.license:xxxxxxxxxxxxxxxx group.admin

Configuration

OptionDefaultDescription
enabledtrueEnable editor
commandmechanicsAdmin command name
permissions(object)Allowed groups/permissions per framework + optional txAdmin/ACE layer — see Permissions
freecamKeybindF7Toggle freecam key
liveSynctrueImmediate hot reload
draft.maxMechanics200Maximum mechanic locations
draft.maxNameLength30Max mechanic name length