Skip to main content
Complete installation, modes, hooks, theme, and API reference for fnx-pvp-aimlab.
fnx-pvp-aimlab provides instanced target-training modes with loadouts, records, Elo, and leaderboard integration.

First installation

ensure oxmysql
ensure community_bridge

ensure fnx-pvp-panel
ensure fnx-pvp-aimlab
The resource creates its required database tables automatically. You do not need to import an SQL file.

First setup

Edit both public cfg files. For every mode, test player spawns, polygon, targets, timing, and inventory item names before opening it to players.

Client configuration

Plugin

KeyDefaultExplanation
ClientCfg.Plugin.id"aimlab"Unique panel plugin ID.
ClientCfg.Plugin.labelKey"plugins.aimlab.label"Locale key for its title.
ClientCfg.Plugin.descriptionKey"plugins.aimlab.description"Locale key for its description.
ClientCfg.Plugin.icon"fa-solid fa-bullseye"Font Awesome icon class.
ClientCfg.Plugin.resourcePVP_AIMLAB_RESOURCEResource owning the plugin.
ClientCfg.Plugin.ui"web/dist/index.html"Built NUI page.
ClientCfg.Plugin.order45Panel sort position.
ClientCfg.Plugin.enabledtrueEnables plugin registration.

Commands and runtime

KeyDefaultExplanation
Commands.open.enabledtrueEnables the open command.
Commands.open.name"aimlab"Command name without /.
Commands.leave.enabledtrueEnables the leave command/key.
Commands.leave.name"leaveaimlab"Leave command name.
Commands.leave.key"F6"Default FiveM key mapping.
Commands.leave.keyDescription"Leave Aimlab"Text in FiveM keybind settings.
Runtime.closePanelOnJointrueCloses the PVP panel after joining.
Runtime.returnCoordsnilOptional client return vec4; nil uses server/default handling.

Client hooks

KeyArgumentsCalled when
Events.OnAimlabJoinpayloadThe player joins. Default code equips the current ox_inventory weapon.
Events.OnAimlabLeavenoneThe player leaves.
Events.OnAimlabHudOpenpayloadThe HUD opens.
Events.OnAimlabHudUpdatepayloadHUD data changes.
Events.OnAimlabShotnoneA tracked shot is fired.
Events.OnAimlabTargetKillpayloadA target is killed.
Events.OnAimlabTargetMisspayloadA target is missed/expires.
Events.OnGameEventTriggeredevent callback or nilOptional raw game-event callback.

Server configuration

Inventory, join, and routing

KeyDefaultExplanation
Inventory.enabledbridge-dependentEnables inventory snapshot/loadout handling.
Inventory.keepInventoryfalseDisables Aimlab inventory/loadout management and lets players keep items.
Inventory.mode"auto"Inventory path: auto, bridge, or native.
Inventory.weaponMetadata.enabledtrueGives weapon ammo/components inside weapon metadata instead of as separate inventory items.
Inventory.weaponMetadata.durability10000Durability value written to weapon metadata when metadata mode is enabled.
Inventory.weaponMetadata.ammotrueStores configured ammo in weapon metadata and skips the separate ammo item grant.
Inventory.weaponMetadata.componentstrueStores configured components in weapon metadata and skips separate component item grants.
Join.warning.enabledbridge-dependentEnables inventory-change confirmation.
Join.warning.holdSeconds1Seconds the confirmation must be held.
Join.warning.timeoutSeconds30Seconds before confirmation expires.
Aimlab.returnCoordsnilOptional server return vec4.
Aimlab.bucketBase50000First Aimlab routing bucket; avoid overlaps.
Aimlab.returnBucket0Bucket restored on leave.
Runtime.defaultElo0Starting Aimlab Elo.
Runtime.modesarrayAvailable training modes.

Logs

Each log category supports enabled, username, avatar, webhooks, and embed. webhooks is an array, so one category can send to multiple Discord webhooks. embed is a Lua function and can be fully customized per server.
CategorySent when
Logs.joinA player joins an Aimlab mode.
Logs.exitA player exits or drops from Aimlab, including kills/shots.
Logs.inventoryStoredA player’s inventory snapshot is stored before Aimlab loadout is applied.
Logs.inventoryRestoreA player’s original inventory is restored.

Mode schema

KeyTypeExplanation
idstringUnique mode ID used by runtime and records.
labelKeystringLocale key for the mode name.
descriptionKeystringLocale key for its description.
imagestringMenu image source.
maxPlayersnumberMaximum simultaneous players.
respawnPointsvector4 arrayPlayer positions and headings.
area.typestringArea implementation; current modes use poly.
area.pointsvector3 arrayPolygon vertices in boundary order.
area.thicknessnumberVertical polygon depth/tolerance.
area.debugbooleanDraws area debug information; disable in production.
targetModelstringGTA ped model used for targets.
targetPointsvector4 arrayTarget positions and headings.
targetModestringBehavior: configured modes use grid, single, or single_roll.
respawnDelayMsnumberDelay before a new target in milliseconds.
targetLifetimeMsnumberTime before a target counts as missed, in milliseconds.
weaponsarrayMode loadout choices.

Weapon schema

KeyTypeExplanation
idstringUnique UI/runtime weapon ID.
namestringGTA weapon name.
hashhashFiveM weapon hash.
labelstringHuman-readable name.
ammonumberAmmo issued.
itemsData.weaponstringInventory weapon item.
itemsData.ammostring or nilInventory ammo item.
itemsData.componentsarrayInventory component item names.

Server hooks

KeyArgumentsCalled when
Events.OnAimlabJoinplayer, modeA player joins.
Events.OnAimlabLeaveplayer, mode, droppedA player leaves or disconnects.
Events.OnAimlabStatplayer, kind, amount, payload, modeA statistic is accepted.
Events.OnAimlabTargetKillplayer, payload, modeA target kill is accepted.
Events.OnAimlabTargetMissplayer, payload, modeA target miss is accepted.

Shared files

Private shared files contain internal constants and helpers. Aimlab has no public shared cfg.

Theme system

Colors accept CSS strings; radii are pixels; fonts are CSS font stacks.
KeyControls
colors.panelBgMain background.
colors.panelBgStrongDarker background.
colors.accentPrimary highlight.
colors.accentStrongStrong highlight.
colors.textPrimary text.
colors.mutedTextSecondary text.
colors.surfaceNormal card surface.
colors.surfaceStrongStrong card surface.
colors.borderBorders/separators.
colors.overlayModal overlay.
colors.successSuccess foreground.
colors.successBgSuccess background.
colors.dangerError foreground.
colors.dangerBgError background.
colors.warningWarning foreground.
colors.warningBgWarning background.
colors.infoInformation foreground.
colors.infoBgInformation background.
radii.panelPanel radius.
radii.cardCard radius.
radii.controlControl radius.
radii.pillBadge radius; 999 makes a pill.
fonts.bodyNormal-text font stack.
fonts.displayHeading font stack.

Developer info

Client exportPurpose
OpenMenu()Opens Aimlab.
CloseMenu()Closes Aimlab.
IsInAimlab()Returns local membership state.
SetHud(payload)Sets HUD data.
UpdateHud(payload)Updates HUD data.
ReportStat(kind, amount)Reports one statistic.
HandleDamageEvent(eventName, args)Passes a game damage event to Aimlab.
HandleEntityDamaged(victim, hitting, weapon, baseDamage)Passes normalized entity damage.

Server exports

ExportParametersReturns / purpose
GetLeaderboardPagerequestReturns the Aimlab leaderboard page requested by the panel or another server resource.
GetLeaderboardEntrieslimit, sortMetricReturns Aimlab leaderboard entries, optionally limited and sorted by the requested metric.

Common issues

Targets do not appear

Check model, points, target mode, and timing. Keep every point inside the polygon.

The player is outside the area

Check spawn points, polygon order, and thickness; temporarily enable area.debug.

Loadouts fail

Verify inventory mode and every itemsData name.

Some configured weapons are not given

Each weapon is applied with its ammunition and components as one package. If a complete package does not fit, only that weapon is skipped. Other weapons are still given and the player receives one notification showing how many weapons were skipped.

Stats count twice

Use one report path per action; do not duplicate automatic damage handling.

Folder structure

Common folders

PathWhat it is for
fxmanifest.luaFiveM manifest. It loads the resource files in the correct order.
settings/public/client/cfg.luaClient settings that server owners are expected to edit.
settings/public/server/cfg.luaServer settings that server owners are expected to edit.
settings/private/**/_cfg.luaInternal/default settings. Do not edit unless you are modifying the resource itself.
client/public/*.luaPublic client API files and safe integration files.
client/private/*.luaInternal client runtime code.
server/public/*.luaPublic server API files and exports.
server/private/*.luaInternal server runtime code.
shared/public/*.luaShared public data or integration constants.
shared/private/*.luaShared internal helpers loaded by the resource.
locales/*.jsonLocales for ui and game.
web/dist/Built NUI files used in-game. Do not edit these by hand.
fnx-pvp-aimlab/
|-- client/
|   |-- private/
|   |   \-- _main.lua
|   \-- public/
|       \-- main.lua
|-- locales/
|   \-- *.json
|-- server/
|   |-- private/
|   |   |-- _database.lua
|   |   |-- _events.lua
|   |   |-- _inventory.lua
|   |   |-- _main.lua
|   |   |-- _modes.lua
|   |   |-- _runtime.lua
|   |   \-- _state.lua
|   \-- public/
|       \-- main.lua
|-- settings/
|   |-- private/
|   |   |-- client/
|   |   |   \-- _cfg.lua
|   |   \-- server/
|   |       \-- _cfg.lua
|   \-- public/
|       |-- client/
|       |   \-- cfg.lua
|       \-- server/
|           \-- cfg.lua
|-- shared/
|   \-- private/
|       \-- _main.lua
|-- web/
|   \-- dist/
\-- fxmanifest.lua