# Micio Mods: full documentation > Every published guide for the Micio Mods FiveM scripts, concatenated into one file. The curated index with the product catalogue is at https://miciomods.it/llms.txt 172 guides. Each one is also available on its own at https://miciomods.it/docs/.md --- # BRIDGE: Dependencies > Required and optional dependencies for ML Bridge Category: BRIDGE · Source: https://miciomods.it/docs/ml-bridge-dependencies · Last updated: 2026-09-26 ## Required - [ox_lib](https://github.com/overextended/ox_lib): Callbacks, zones, DUI, notifications ## Framework **QBCore** **server.cfg** ```cfg ensure qb-core ensure ox_lib ensure ml_bridge ``` **Qbox** **server.cfg** ```cfg ensure qbx_core ensure ox_lib ensure ml_bridge ``` **ESX** **server.cfg** ```cfg ensure es_extended ensure ox_lib ensure ml_bridge ``` **ox_core** **server.cfg** ```cfg ensure ox_core ensure ox_lib ensure ml_bridge ``` **Standalone** **server.cfg** ```cfg ensure ox_lib ensure ml_bridge ``` > **INFO:** Auto Detection > > `ml_bridge` detects your framework automatically. ## Optional All of the following are auto-detected. If present on your server, `ml_bridge` will use them. ### Inventory Systems - [ox_inventory](https://github.com/overextended/ox_inventory) - qb-inventory / lj-inventory - ps-inventory - qs-inventory - codem-inventory - core_inventory - origen_inventory - tgiann-inventory - one_inventory - devix-inventory - jaksam_inventory - ak47_inventory ### Target Systems - [ox_target](https://github.com/overextended/ox_target) - qb-target - sleepless_interact ### Dispatch Systems - ps-dispatch - cd_dispatch - qs-dispatch - op-dispatch - rcore_dispatch - origen_police - bub-mdt - lb-dispatch - wasabi_mdt - tk_dispatch - fd_dispatch - emergencydispatch ### Fuel Systems - ml_fuel - LegacyFuel - ox_fuel - cdn-fuel / ps-fuel / nd_fuel / qs-fuel - renewed-fuel / x-fuel ### Vehicle Keys - ml_vehiclekeys - qbx_vehiclekeys / qb-vehiclekeys - wasabi_carlock - Renewed-Vehiclekeys / qs-vehiclekeys - cd_garage / jaksam_vehicles - t1ger_keys / mk_vehiclekeys - freal_vehiclekeys / mrnewb_keys - mvehicle / okokgarage ### Clothing - illenium-appearance - fivem-appearance - qb-clothing - rcore_clothing ### Other - [pma-voice](https://github.com/AvarianKnight/pma-voice): Voice integration - [FiveManage](https://fivemanage.com): Log provider (optional, see Configuration) --- # BRIDGE: Configuration > Configuration reference for ML Bridge Category: BRIDGE · Source: https://miciomods.it/docs/ml-bridge-configuration · Last updated: 2026-07-28 ## Overview - `config.lua`: Auto-detection overrides, debug, waypoint settings, inventory image path - `config_server.lua`: Admin permissions, log provider, FiveManage token All settings live in two files. Most values should remain `'auto'`. ## System Detection **config.lua** ```lua Config.Framework = 'auto' Config.Inventory = 'auto' Config.Target = 'auto' Config.Notify = 'auto' Config.Dispatch = 'auto' Config.ProgressBar = 'auto' Config.Fuel = 'ml_fuel' Config.Input = 'auto' Config.Menu = 'auto' Config.HelpText = 'auto' Config.VehicleKeys = 'ml_vehiclekeys' Config.Clothing = 'auto' ``` - Each value can be set to `'auto'` (recommended) or forced to a specific provider name - `'auto'` probes which resource is started and picks the first match - Override only when you have multiple systems installed and want to force a specific one ## General **config.lua** ```lua Config.Debug = false ``` - `Debug`: Prints detection results and internal logs. Keep off in production. ## Admin Permissions **config_server.lua** ```lua Config.AdminPermissions = { 'admin', 'god', 'superadmin' } ``` - `AdminPermissions`: ACE permission groups that `Bridge.HasPermission()` checks against. Add or remove groups to match your server's permission structure. ## Logging **config_server.lua** ```lua Config.LogProvider = 'discord' Config.FiveManageToken = '' Config.FiveManageDataset = 'default' ``` - `LogProvider`: Which provider(s) to send logs to: - `'discord'`: Discord webhooks only - `'ox_lib'`: ox_lib logger only - `'fivemanage'`: FiveManage only - `'both'`: Discord + FiveManage - `'all'`: Discord + ox_lib + FiveManage - `FiveManageToken`: API token for FiveManage (can also be set via convar `fivemanage:key`) - `FiveManageDataset`: FiveManage dataset name Logs are batched and sent every 60 seconds. Discord batches max 10 embeds, FiveManage batches max 25 entries. > **TIP:** Disable a Log > > In any ML script's webhook config, set a webhook to `false` to disable that log entirely. ## Inventory Image Path **config.lua** ```lua Config.InventoryImagePath = nil Config.InventoryImageExt = '.webp' ``` - `InventoryImagePath`: Override the image path for item icons. `nil` = auto-detect based on inventory system - `InventoryImageExt`: Override the image file extension. Default `'.webp'`, falls back to `'.png'` on some inventories Auto-detected paths per inventory system: `nui://ox_inventory/web/images/`, `nui://qb-inventory/html/images/`, etc. ## Waypoints **config.lua** ```lua Config.Waypoints = { syncToWayPoint = true, mapWaypoint = { type = 'checkpoint', label = 'WAYPOINT', color = '#f500fc', size = 1.0, drawDistance = 1000.0, }, defaults = { drawDistance = 500.0, fadeDistance = 400.0, size = 1.0, minHeight = 0.5, maxHeight = 50.0, groundZOffset = -2.0, color = '#f5a623', label = 'CHECKPOINT', displayDistance = true, }, dui = { width = 512, height = 1024, }, rendering = { updateInterval = 100, distanceUpdateInterval = 100, perspectiveDivisor = 20.0, checkpointBaseMultiplier = 4.0, checkpointMinScale = 0.1, checkpointAspectRatio = 2.0, smallMinScale = 1.0, smallAspectRatio = 2.0, }, server = { cleanupInterval = 60000, }, } ``` - `syncToWayPoint`: Automatically create a 3D waypoint marker when the player sets a GTA map waypoint - `mapWaypoint`: Visual style for the auto-synced map waypoint - `defaults`: Default values for any waypoint created without specifying these fields - `dui`: DUI texture resolution. Higher values = sharper text, more VRAM - `rendering`: Performance tuning for the render loop. `updateInterval` controls how often visibility checks run (ms) - `server.cleanupInterval`: How often the server prunes waypoints for disconnected players (ms) For full Waypoints documentation, see the dedicated **Waypoints** page. --- # BRIDGE: Installation > Setup guide for ML Bridge Category: BRIDGE · Source: https://miciomods.it/docs/ml-bridge-installation · Last updated: 2026-09-26 ## Overview Shared integrations for the ML Series. `ml_bridge` detects supported frameworks, inventories and target systems, and provides a common API for ML scripts. It also includes log providers and in-world 3D waypoints. ## Quick Start 1. Download from [CFX Portal](https://portal.cfx.re) 2. Extract to your `resources` folder as `ml_bridge` 3. Add to `server.cfg`: **server.cfg** ```cfg ensure ox_lib ensure ml_bridge ``` > **WARNING:** Load Order > > `ml_bridge` must start BEFORE any `ml_*` script that depends on it. ## Database > **INFO:** No Database > > `ml_bridge` does not create any database tables. It is a stateless abstraction layer. ## Verify After starting, the console will print: ```lua [ml_bridge] Detection Results: Framework: qbox Inventory: ox Target: ox Notify: ox ... [ml_bridge] Server bridge ready ``` Each detected system is printed with its resolved provider. If `Config.Debug = true`, additional debug output is shown. **Troubleshooting** - Script not starting. Ensure `ox_lib` is loaded before `ml_bridge`. - Detection shows `unknown`: The target resource is not started. Check your ensure order. - ML scripts fail to load, `ml_bridge` must be ensured before any `ml_*` script. --- # BRIDGE: Waypoints > 3D DUI-based waypoints and markers system for ML Bridge Category: BRIDGE · Source: https://miciomods.it/docs/ml-bridge-waypoints · Last updated: 2026-08-12 ## Overview The Waypoints system renders 3D markers using DUI (Direct UI) textures. Each marker has its own HTML-rendered label, icon, distance counter, and theming, all drawn as a billboard in the game world. Two visual types are available: - `checkpoint`: Tall vertical marker with a line-to-ground. Used for mission objectives and destinations - `small`: Ground-level diamond marker. Used for loot spots, interaction points, hidden areas DUI instances are pooled and reused: markers only acquire a DUI when they enter the player's view, and release it when offscreen. This keeps performance flat regardless of total waypoint count. ## Themes - Default: Industrial Orange - `'cyberpunk'`: Neon Magenta, glow pulse - `'wasteland'`: Rust tones, dashed borders - `'noir'`: Blood Red, minimal - `'fantasy'`: Gold, double border - `'survival'`: Earth tones, retro ## Client Exports ### Create ```lua local id = exports.ml_bridge:WaypointCreate(data) ``` Creates a client-side waypoint. Returns the waypoint ID. ### Update ```lua exports.ml_bridge:WaypointUpdate(id, { label = 'New Label', color = '#ff0000' }) ``` Partial update, only send the fields you want to change. ### Remove ```lua exports.ml_bridge:WaypointRemove(id) ``` ### Remove All ```lua exports.ml_bridge:WaypointRemoveAll() ``` ### Get ```lua local wp = exports.ml_bridge:WaypointGet(id) ``` Returns the waypoint data table or `nil`. ## Server Exports ### Create for Specific Player ```lua local id = exports.ml_bridge:WaypointCreate(source, data) ``` ### Create for All Players ```lua local id = exports.ml_bridge:WaypointCreate(-1, data) ``` ### Create for Multiple Players ```lua local id = exports.ml_bridge:WaypointCreate({src1, src2, src3}, data) ``` ### Update ```lua exports.ml_bridge:WaypointUpdate(id, { label = 'Updated' }) ``` ### Remove ```lua exports.ml_bridge:WaypointRemove(id) ``` ### Remove All for a Player ```lua exports.ml_bridge:WaypointRemoveForPlayer(source) ``` ### Remove All Globally ```lua exports.ml_bridge:WaypointRemoveAll() ``` ### Query ```lua local wp = exports.ml_bridge:WaypointGet(id) local all = exports.ml_bridge:WaypointGetAll() local playerWps = exports.ml_bridge:WaypointGetForPlayer(source) ``` ## Waypoint Parameters All parameters for the `data` table passed to `WaypointCreate`: - `coords` (vec3), **Required.** World position of the waypoint - `type` (string), `'checkpoint'` or `'small'`. Default: `'small'` - `label` (string). Display text. Default: `'CHECKPOINT'` - `icon` (string). FontAwesome icon name (without `fa-`). Example: `'store'`, `'flag'`, `'skull'` - `image` (string). URL to an image (alternative to icon) - `color` (string). Hex color. Default: `'#f5a623'` - `theme` (string). Theme name (see list above). Default: none - `size` (number). Scale multiplier. Default: `1.0` - `drawDistance` (number). Max camera distance for rendering. Default: `500.0` - `fadeDistance` (number). Distance where fade-out begins. Default: `400.0` - `displayDistance` (boolean). Show distance counter. Default: `true` - `groundZ` (number). Z position of the ground line (checkpoint type only). Default: `coords.z - 2.0` - `heightOffset` (number). Vertical offset from ground (small type only). Default: `0` - `removeDistance` (number). Auto-remove when the player reaches this distance. Fades out over 5 seconds before removal - `activateDistance` (number). Waypoint is invisible until the player is within this distance ## Behaviors ### Always Visible (Default) The waypoint appears whenever the player is within `drawDistance`. ```lua exports.ml_bridge:WaypointCreate({ coords = vec3(200, 300, 30), type = 'checkpoint', label = 'Shop', icon = 'store', }) ``` ### Auto-Remove on Approach The waypoint fades out over 5 seconds and removes itself when the player reaches `removeDistance`. ```lua exports.ml_bridge:WaypointCreate({ coords = vec3(200, 300, 30), type = 'checkpoint', label = 'Pickup', icon = 'hand', removeDistance = 2.0, }) ``` ### Proximity Activation The waypoint is invisible until the player is within `activateDistance`. ```lua exports.ml_bridge:WaypointCreate({ coords = vec3(200, 300, 30), type = 'small', label = 'Hidden', icon = 'eye', activateDistance = 30.0, }) ``` ### Combo: Activate + Remove The waypoint appears when nearby and removes itself on arrival. ```lua exports.ml_bridge:WaypointCreate({ coords = vec3(200, 300, 30), type = 'checkpoint', label = 'Objective', icon = 'bullseye', theme = 'cyberpunk', activateDistance = 50.0, removeDistance = 3.0, }) ``` ## Examples **Mission Checkpoints** ```lua local checkpoints = { vec3(100, 200, 30), vec3(150, 250, 32), vec3(200, 300, 28), } local wpIds = {} for i, pos in ipairs(checkpoints) do wpIds[i] = exports.ml_bridge:WaypointCreate({ coords = pos, type = 'checkpoint', label = ('Checkpoint %d'):format(i), icon = 'flag', color = '#4ecdc4', removeDistance = 3.0, }) end -- cleanup for _, id in ipairs(wpIds) do exports.ml_bridge:WaypointRemove(id) end ``` **Loot Spots on Ground** ```lua local lootSpots = { { pos = vec3(100, 200, 30), item = 'Crate' }, { pos = vec3(120, 210, 30), item = 'Backpack' }, } for _, spot in ipairs(lootSpots) do exports.ml_bridge:WaypointCreate({ coords = spot.pos, type = 'small', label = spot.item, icon = 'box', theme = 'wasteland', activateDistance = 20.0, removeDistance = 2.0, }) end ``` **Server-Side Global Event Marker** ```lua RegisterCommand('event', function(source) exports.ml_bridge:WaypointCreate(-1, { coords = vec3(300, 400, 30), type = 'checkpoint', label = 'Event', icon = 'star', color = '#ff6600', theme = 'fantasy', drawDistance = 999.0, }) end, true) ``` **Map Waypoint Sync** When `Config.Waypoints.syncToWayPoint = true`, `ml_bridge` automatically creates a 3D checkpoint marker whenever the player sets a GTA map waypoint. The marker follows the blip position and is removed when the waypoint is cleared. No code is needed, this is automatic. ## Performance - DUI textures are pooled and reused. Creating/removing waypoints does not allocate/deallocate GPU resources - Offscreen waypoints release their DUI back to the pool automatically - Visibility checks run every `Config.Waypoints.rendering.updateInterval` ms (default 100) - Distance updates to the DUI are throttled independently - Server-side cleanup prunes waypoints for disconnected players every `Config.Waypoints.server.cleanupInterval` ms --- # BRIDGE: Developer > Developer API reference for ML Bridge Category: BRIDGE · Source: https://miciomods.it/docs/ml-bridge-developer · Last updated: 2026-08-18 ## Overview `ml_bridge` exposes a unified API via the `Bridge` global table. Any ML script that loads `@ml_bridge/init.lua` can call `Bridge.FunctionName()` directly. External scripts can use `exports.ml_bridge:FunctionName()`. ## Server Exports ### System Info - `Bridge.IsReady()`: Returns `true` when the bridge is initialized - `Bridge.GetFramework()`: Returns detected framework name (`'qbox'`, `'qbcore'`, `'esx'`, `'oxcore'`, `'standalone'`) - `Bridge.GetInventorySystem()`: Returns detected inventory system (`'ox'`, `'qb'`, `'ps'`, `'qs'`, `'codem'`, `'core'`, `'origen'`, `'tgiann'`, `'one'`, `'devix'`, `'jaksam'`, `'ak47'`) - `Bridge.SupportsMetadata()`: Returns `true` if the detected inventory supports item metadata - `Bridge.GetPlayers()`: Returns table of all online player source IDs ### Player Identity - `Bridge.HasPermission(src, permission?)`: Returns `true` if the player has admin permission (checks `Config.AdminPermissions`) - `Bridge.GetPlayer(src)`: Returns the native framework player object - `Bridge.GetPlayerId(src)`: Returns the character ID (citizenid for QB, identifier for ESX) - `Bridge.GetPlayerName(src)`: Returns the Steam/FiveM player name - `Bridge.GetLicense(src)`: Returns the player's license identifier (license2 preferred) - `Bridge.GetDiscord(src)`: Returns Discord mention format (`<@id>`) or `'Not Linked'` - `Bridge.GetSteam(src)`: Returns Steam identifier or `'Unknown'` ### Job and Duty - `Bridge.GetJob(src)`: Returns job data table (`{ name, grade, label }`) - `Bridge.SetJob(src, jobName, grade)`: Sets the player's job - `Bridge.HasJob(src, jobName)`: Returns `true` if player has the specified job - `Bridge.GetDuty(src)`: Returns `true` if player is on duty - `Bridge.SetDuty(src, status)`: Sets duty status - `Bridge.GetPlayersByJob(jobName)`: Returns table of source IDs for all players with the specified job - `Bridge.GetFrameworkJobs()`: Returns all registered jobs from the framework ### Inventory - `Bridge.HasItem(src, item, amount?)`: Returns `true` if player has at least `amount` (default 1) of the item - `Bridge.GetItemCount(src, item)`: Returns the count of a specific item - `Bridge.GetItem(src, item)`: Returns item data object - `Bridge.GetItems(src)`: Returns all items in the player's inventory. Every entry carries name, count, slot, and metadata regardless of the inventory system - `Bridge.GiveItem(src, item, amount, meta?)`: Gives an item to the player. Returns success boolean - `Bridge.RemoveItem(src, item, amount)`: Removes an item from the player. Returns success boolean - `Bridge.GetSlot(src, slot)`: Returns the item in a specific slot - `Bridge.RemoveSlot(src, slot, count?)`: Removes items from a specific slot - `Bridge.SetItemMeta(src, slot, metadata)`: Updates metadata for an item in a slot - `Bridge.CanCarry(src, item, count)`: Returns `true` if the player can carry the specified amount - `Bridge.ClearInventory(src)`: Wipes the player's entire inventory - `Bridge.ConfiscateInventory(src)`: Confiscates inventory (framework-specific) - `Bridge.RestoreInventory(src, items?)`: Restores a previously confiscated inventory - `Bridge.GetRegisteredItems()`: Returns all items registered in the inventory system - `Bridge.BindUsableItem(item, callback)`: Registers a usable item handler - `Bridge.DegradeItem(src, slot, amount)`: Reduces item durability - `Bridge.DrainWeaponDurability(src, weaponHash, amount)`: Reduces weapon durability - `Bridge.GiveItemToFit(src, item, amount, meta?)`: Gives as many items as the player can carry. Returns `success, actualAmount` ### Money - `Bridge.GetMoney(src, account?)`: Returns balance for the specified account (default `'cash'`) - `Bridge.AddMoney(src, account, amount)`: Adds money to the specified account - `Bridge.RemoveMoney(src, account, amount)`: Removes money from the specified account ### Stash - `Bridge.OpenStash(src, id, label, slots, weight, items?, props?)`: Opens a stash for a player - `Bridge.OpenPlayerStash(src, targetSrc, slots, weight)`: Opens another player's inventory as a stash - `Bridge.GetStash(id)`: Returns the contents of a stash - `Bridge.IsStashEmpty(id)`: Returns `true` if the stash has no items - `Bridge.ClearStash(id)`: Empties a stash - `Bridge.RegisterInventoryHook(hookType, callback, options?)`: Registers a hook for inventory events (swapItems, buyItem, etc.) ### Player Status - `Bridge.GetMeta(src, key)`: Returns player metadata for a specific key - `Bridge.SetMeta(src, key, value)`: Sets player metadata - `Bridge.GetDob(src)`: Returns the character's date of birth - `Bridge.GetPhone(src)`: Returns the character's phone number - `Bridge.GetGang(src)`: Returns the character's gang data - `Bridge.GetHunger(src)`: Returns hunger value - `Bridge.AddHunger(src, amount)`: Adds hunger - `Bridge.SetHunger(src, value)`: Sets hunger to an exact value - `Bridge.GetThirst(src)`: Returns thirst value - `Bridge.AddThirst(src, amount)`: Adds thirst - `Bridge.SetThirst(src, value)`: Sets thirst to an exact value - `Bridge.GetStress(src)`: Returns stress value - `Bridge.AddStress(src, amount)`: Adds stress - `Bridge.RemoveStress(src, amount)`: Removes stress ### Life Cycle - `Bridge.Login(src, data)`: Triggers the player login flow - `Bridge.Logout(src)`: Triggers the player logout flow - `Bridge.IsPlayerDead(src)`: Returns `true` if the player is dead (alias: `Bridge.IsDead`) - `Bridge.Revive(src)`: Revives the player ### Vehicles - `Bridge.GetOwnedVehicles(src)`: Returns all vehicles owned by the player - `Bridge.SetVehicleFuel(vehicle, amount)`: Sets fuel level (requires a server-side entity) ### Notification and Logging - `Bridge.NotifyPlayer(src, type, message, duration?)`: Sends a notification to a player via client event. Types: `'info'`, `'success'`, `'error'`, `'warning'` - `Bridge.Log(opts)`: Multi-provider logging (see Logging section below) ### Callbacks - `Bridge.OnServerRequest(name, callback, secure?)`: Registers a named server-side callback that can be invoked from clients via `Bridge.RequestServer`. When `secure = true`, only the registering resource can invoke it ```lua -- Server: register a callback Bridge.OnServerRequest('myScript:getData', function(src, param1) return { result = 'ok', value = param1 } end, true) -- secure = true, only this resource can call it ``` ## Client Exports ### System Info - `Bridge.IsReady()`: Returns `true` when the bridge is initialized - `Bridge.GetFramework()`: Returns detected framework name - `Bridge.GetInventorySystem()`: Returns detected inventory system - `Bridge.SupportsMetadata()`: Returns `true` if the detected inventory supports item metadata - `Bridge.IsPlayerLoaded()`: Returns `true` when the player character is fully loaded ### Inventory - `Bridge.HasItem(item, amount?)`: Returns `true` if the local player has the item - `Bridge.GetItem(item)`: Returns item data for a specific item - `Bridge.GetItems()`: Returns all items in the local inventory. Every entry carries name, count, slot, and metadata regardless of the inventory system - `Bridge.GetItemLabel(item)`: Returns the display label for an item - `Bridge.GetItemDefinitions()`: Returns all registered item definitions from the inventory system - `Bridge.GetInventoryImagePath()`: Returns the path to inventory images - `Bridge.GetInventoryImageExt()`: Returns the image file extension (default `.png`) - `Bridge.OpenInventory()`: Opens the inventory UI - `Bridge.CloseInventory()`: Closes the inventory UI - `Bridge.OpenStash(stashId, onClose?)`: Opens a stash. Accepts an optional `onClose` callback - `Bridge.OnInventoryChange(callback)`: Registers a callback fired when inventory content changes - `Bridge.SearchItems(item)`: Searches the inventory for an item - `Bridge.RegisterItemUse(item, callback)`: Registers a client-side usable item handler - `Bridge.DisplayMetadata(data)`: Displays metadata in the inventory UI ### Weapons - `Bridge.GetCurrentWeapon()`: Returns current weapon data (`{ hash, name, slot, durability, melee }`) or `nil` - `Bridge.HasWeaponEquipped()`: Returns `true` if a weapon is equipped ### Player State - `Bridge.GetJob()`: Returns current job data (`{ name, grade, label }`) - `Bridge.GetPlayerStatus()`: Returns `hunger, thirst` values - `Bridge.IsPlayerDead()`: Returns `true` if the player is dead ### Vehicle - `Bridge.GiveVehicleKey(plate)`: Gives keys for the specified vehicle plate - `Bridge.RemoveVehicleKey(plate)`: Removes keys for the specified vehicle plate - `Bridge.GetVehicleFuel(vehicle)`: Returns fuel level - `Bridge.SetVehicleFuel(vehicle, amount)`: Sets fuel level ### UI - `Bridge.Notify(msg, notifType?, duration?)`: Shows a notification. Types: `'info'`, `'success'`, `'error'`, `'warning'`. Duration in ms (default 3000) - `Bridge.ShowTextUI(text, options?)`: Shows a help text UI element - `Bridge.HideTextUI()`: Hides the help text - `Bridge.Progress(options)`: Shows a progress bar. Returns `true` if completed - `Bridge.ProgressCircle(options)`: Shows a circular progress bar - `Bridge.CancelProgress()`: Cancels an active progress bar - `Bridge.InputDialog(title, inputs)`: Opens an input dialog. Returns submitted values - `Bridge.ContextMenu(options)`: Opens a context menu - `Bridge.ShowMenu(options)`: Opens a list menu - `Bridge.HideMenu()`: Closes the active menu ### Dispatch - `Bridge.AlertDispatch(data)`: Sends a dispatch alert. Auto-detects dispatch system (ps-dispatch, cd_dispatch, qs-dispatch, op-dispatch, rcore_dispatch, origen_police). Falls back to built-in blip+notification system ```lua Bridge.AlertDispatch({ message = 'Store Robbery', description = 'Armed robbery in progress', coords = GetEntityCoords(cache.ped), jobs = { 'police', 'sheriff' }, code = '10-31', blip = { sprite = 58, scale = 1.0, color = 1, flash = true, text = 'Robbery' }, }) ``` The fallback creates a map blip that lasts 2 minutes and shows a phone notification. ### Target Interactions Target interactions are handled through `ml_bridge`. Supports ox_target, qb-target, sleepless_interact, and a TextUI fallback. - `Bridge.AddEntityTarget(entity, options)`: Adds target options to a specific entity - `Bridge.RemoveEntityTarget(entity, options?)`: Removes target from an entity - `Bridge.AddModelTarget(model, options)`: Adds target to all entities with a specific model - `Bridge.RemoveModelTarget(model, options?)`: Removes model target - `Bridge.AddPlayerTarget(options)`: Adds target options to players - `Bridge.RemovePlayerTarget(options?)`: Removes player target - `Bridge.AddVehicleTarget(options)`: Adds target options to vehicles - `Bridge.RemoveVehicleTarget(options?)`: Removes vehicle target - `Bridge.AddPedTarget(options)`: Adds target options to peds - `Bridge.RemovePedTarget(options?)`: Removes ped target - `Bridge.AddNetEntityTarget(netId, options)`: Adds target to a network entity by net ID - `Bridge.RemoveNetEntityTarget(netId, options?)`: Removes target from net entity - `Bridge.AddZoneTarget(options)`: Adds a box-zone target - `Bridge.RemoveZoneTarget(name)`: Removes a zone target - `Bridge.AddTargetZone(options)`: Alias for `AddZoneTarget` - `Bridge.RemoveTargetZone(name)`: Alias for `RemoveZoneTarget` - `Bridge.AddTargetSphereZone(options)`: Adds a sphere-zone target - `Bridge.RemoveTargetSphereZone(name)`: Removes a sphere-zone target - `Bridge.DisableTargeting(disabled)`: Globally disables/enables the targeting system ### Minigames - `Bridge.KeySequence(coords, length, hiddenMode, label?, infoText?)`: Shows a 3D key sequence minigame at world `coords`. Player must press `length` random keys (V, C, E, F, G, H, I, X) in order. `hiddenMode` scrambles upcoming keys. Returns `true` on success, `false` on ESC/wrong key - `Bridge.HoldKeySequence(coords, rows, length, timePerKey, label?, infoText?)`: Shows a multi-row hold-key minigame. Each key must be held for `timePerKey` ms. `rows` defines parallel sequences. Returns `true` on completion - `Bridge.ProgressBar3D(coords, duration, scale?, distance?)`: Shows a 3D progress bar in world space at `coords`. Fades in, fills over `duration` ms, then fades out. `scale` controls size (default `1`), `distance` is max render distance (default `10`). Returns `true` when done ### Callbacks - `Bridge.RequestServer(name, ...)`: Sends a named request to the server and yields the current coroutine until a response arrives (10s timeout). Must be called inside a `CreateThread`. Returns the callback result ```lua -- Client: call a server callback CreateThread(function() local data = Bridge.RequestServer('myScript:getData', 'hello') print(data.result) -- 'ok' end) ``` ## Server Logging API `Bridge.Log` sends logs to one or more providers (Discord, ox_lib, FiveManage) based on `Config.LogProvider`. ```lua Bridge.Log({ webhook = 'https://discord.com/api/webhooks/...', title = 'Item Looted', description = 'Player picked up AK-47', color = 'green', player = source, target = targetSource, fields = { { name = 'Item', value = 'AK-47', inline = true }, { name = 'Zone', value = 'Military Base', inline = true }, }, }) ``` - `webhook`: Discord webhook URL. Set to `false` to skip this log - `title`: Embed title - `description`: Embed description - `color`: Color name (`'blue'`, `'green'`, `'yellow'`, `'orange'`, `'red'`, `'purple'`, `'white'`) - `player`: Source ID. Automatically includes player name, RP name, citizen ID, job, license, Discord, Steam - `target`: Target source ID. Same fields as player - `fields`: Additional embed fields - `provider`: Override the global `Config.LogProvider` for this specific log - `dataset`: Override FiveManage dataset > **TIP:** Player Block > > When `player` or `target` is provided, the log automatically enriches the embed/entry with full player data including RP name, citizen ID, job, and identifiers. No need to build this manually. ## Server Events - `ml_bridge:server:playerLoaded`: Fires when a player finishes loading (any framework: QBCore, Qbox, ESX). Automatically re-caches player identifiers - `ml_bridge:server:playerUnloaded`: Fires when a player disconnects or unloads ## Spatial Utility (Client) The `Spatial` global provides a sector-based proximity tracker. It divides the map into 200m sectors and only checks nearby nodes, making it efficient for large numbers of tracked points. - `Spatial.Track(id, target, distance, onEnter?, onExit?)`: Tracks a position (`vec3`) or entity (`number`). Fires `onEnter` when player is within `distance`, `onExit` when leaving. Returns the node - `Spatial.Remove(id)`: Stops tracking a node - `Spatial.StartLoop()`: Starts the proximity check loop (called automatically on first `Track`) ```lua Spatial.Track('mySpot', vec3(200, 300, 30), 5.0, function(self) print('Entered zone') end, function(self) print('Left zone') end ) -- Later Spatial.Remove('mySpot') ``` > **INFO:** Internal Utility > > `Spatial` is not an export. It is a global available to any client script loaded within `ml_bridge`'s context. ML scripts use it internally for efficient proximity detection without `while true` loops. --- # BRIDGE: F.A.Q > Frequently asked questions for ML Bridge Category: BRIDGE · Source: https://miciomods.it/docs/ml-bridge-faq · Last updated: 2026-08-18 ## Setup **Why is the script not starting?** 1. Ensure `ox_lib` is started before `ml_bridge` in `server.cfg` 2. Verify `ml_bridge` folder exists in resources 3. Check console for dependency errors **Why does detection show "unknown" for my inventory?** 1. The inventory resource must be started before `ml_bridge` 2. Check that the resource name matches exactly (e.g. `ox_inventory`, not `ox-inventory`) 3. Set `Config.Debug = true` and check the detection log **How do I force a specific provider?** Set the corresponding config value instead of `'auto'`: **config.lua** ```lua Config.Inventory = 'ox' Config.Target = 'ox' Config.Fuel = 'LegacyFuel' ``` ## Framework **Which frameworks are supported?** QBCore, Qbox (qbx_core), ESX, ox_core, and Standalone. Detection is automatic based on which core resource is running. ox_core has no job system, so job and gang functions return defaults. Bank account operations and character identity on ox_core require `@ox_core/lib/init.lua` in the ml_bridge fxmanifest. **Can I use ml_bridge without a framework?** Yes. Set `Config.Framework = 'auto'` or force `'standalone'`. Functions that require framework data (jobs, gangs, metadata) return default/nil values. **How does player data sync work?** On player load, `ml_bridge` caches identifiers (license, discord, steam), character ID, RP name, and job. This data is cached for instant access during logging without additional DB queries. ## Inventory **Which inventories are supported?** ox_inventory, qb-inventory, lj-inventory, ps-inventory, qs-inventory, codem-inventory, core_inventory, origen_inventory, tgiann-inventory, one_inventory, devix-inventory, jaksam_inventory, ak47_inventory. All are auto-detected. **How do I use Bridge.HasItem instead of direct exports?** Replace direct inventory calls with Bridge functions: ```lua -- Server local has = Bridge.HasItem(source, 'lockpick', 1) Bridge.RemoveItem(source, 'lockpick', 1) Bridge.GiveItem(source, 'bread', 5) -- Client local has = Bridge.HasItem('lockpick', 1) ``` **How does GiveItemToFit work?** It gives as many items as the player can carry using a binary search on `CanCarry`. Returns two values: ```lua local success, actualAmount = Bridge.GiveItemToFit(source, 'bread', 10) -- If inventory can only hold 7, actualAmount = 7 ``` ## Target **Which target systems are supported?** ox_target, qb-target, sleepless_interact. If none are found, falls back to text-based UI (`'textui'`). **How do I add a target to an entity?** ```lua Bridge.AddEntityTarget(entity, { label = 'Search', icon = 'fas fa-search', distance = 2.0, onSelect = function() print('Searched!') end }) ``` ## Logging **How does multi-provider logging work?** `Bridge.Log` checks `Config.LogProvider` and sends to one or more backends: - `'discord'`: Discord webhook embeds - `'ox_lib'`: ox_lib logger - `'fivemanage'`: FiveManage HTTP API - `'both'`: Discord + FiveManage - `'all'`: All three Logs are batched and sent every 60 seconds to avoid rate limits. **How do I disable a specific log?** In any ML script's config, set the webhook to `false`: ```lua Config.Log = { AdminRevive = 'https://discord.com/api/webhooks/...', PlayerDeath = false, -- disabled } ``` ## Dispatch **Which dispatch systems are supported?** ps-dispatch, cd_dispatch, qs-dispatch, op-dispatch, rcore_dispatch, origen_police, bub-mdt, lb-dispatch, wasabi_mdt, tk_dispatch, fd_dispatch, emergencydispatch. If none are detected, `ml_bridge` provides its own fallback system that creates a timed map blip (2 min) and shows a phone-style notification. **How do I send a dispatch alert?** ```lua Bridge.AlertDispatch({ message = 'Store Robbery', description = 'Armed robbery in progress', coords = GetEntityCoords(cache.ped), jobs = { 'police' }, code = '10-31', blip = { sprite = 58, scale = 1.0, color = 1, flash = true }, }) ``` ## Minigames **What minigames are available?** Three types: - **KeySequence**: Press random keys in order. Supports a hidden mode where upcoming keys are scrambled - **HoldKeySequence**: Multiple rows of keys that must be held for a duration. Supports parallel rows - **ProgressBar3D**: A 3D world-space progress bar with fade in/out All three render in 3D at world coordinates, not in screen space. ## Callbacks **How do client-server callbacks work?** Server registers a named handler with `Bridge.OnServerRequest`. Client calls `Bridge.RequestServer` which yields the coroutine until the server responds (10s timeout). The `secure` flag prevents other resources from invoking a callback registered by your script. ```lua -- Server Bridge.OnServerRequest('myData', function(src, key) return MySQL.query.await('SELECT ...', { key }) end, true) -- Client (inside CreateThread) local result = Bridge.RequestServer('myData', 'someKey') ``` ## Spatial **What is the Spatial utility?** `Spatial` is a client-side sector-based proximity system. It divides the map into 200m sectors and only checks nodes in the player's current sector, making it efficient for tracking many points simultaneously. Use `Spatial.Track(id, coords, distance, onEnter, onExit)` to register a point. The loop starts automatically. ## Waypoints **What is DUI pooling?** DUI (Direct UI) textures are rendered directly into the 3D world. Pooling means DUI instances are created once and reused. When a waypoint goes offscreen, its DUI is returned to the pool. When a new waypoint needs rendering, it grabs an existing DUI from the pool instead of creating a new one. This keeps GPU memory constant. **Do waypoints affect performance?** Minimal impact. Only waypoints visible on screen acquire a DUI. Offscreen waypoints cost zero. Visibility checks run every 100ms. The DUI pool prevents texture creation and destruction overhead. **Can I create waypoints from the server?** Yes. Server exports send waypoint data to specific players, groups, or all players: ```lua -- For one player exports.ml_bridge:WaypointCreate(source, data) -- For everyone exports.ml_bridge:WaypointCreate(-1, data) ``` ## Updates **How do I update the script?** 1. Download latest from CFX Portal 2. Backup `config.lua` and `config_server.lua` 3. Replace all files except config 4. Restart the resource No database, no migration needed. --- # AIRDROP: Dependencies > Required and optional dependencies for ML Airdrop Category: AIRDROP · Source: https://miciomods.it/docs/ml-airdrop-dependencies · Last updated: 2026-08-18 ## Required - [ml_bridge](https://portal.cfx.re): framework layer. Every player, inventory and money action runs through it, so ml_airdrop works on any supported framework. - [ox_lib](https://github.com/communityox/ox_lib): panel UI, server callbacks, progress bars and the built-in open minigame. - [oxmysql](https://github.com/overextended/oxmysql): stores the editable planes, crates, loot, zones and flares, plus the drop history. ## Framework **QBCore** **server.cfg** ```cfg ensure qb-core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_airdrop ``` **Qbox** **server.cfg** ```cfg ensure qbx_core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_airdrop ``` **ESX** **server.cfg** ```cfg ensure es_extended ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_airdrop ``` **Standalone** **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_airdrop ``` > **INFO:** Auto Detection > > `ml_bridge` detects your framework automatically. No manual setup. ## Optional - [ml_skills](https://miciomods.it): grants XP when a drop is looted or a vehicle claimed. Off by default, enabled in `Config.Skills`. - ox_target: only needed when `Config.InteractionMethod` is set to `target`. The default `textui` mode needs nothing extra. - An inventory - loot, the open tools and the flare item are delivered through ml_bridge to whatever inventory your server runs. - mgc: optional provider for the crate open minigame. Without it, the ox_lib skill check is used instead. --- # AIRDROP: Configuration > Configuration reference for ML Airdrop Category: AIRDROP · Source: https://miciomods.it/docs/ml-airdrop-configuration · Last updated: 2026-10-05 ## Overview - `shared/config.lua`: general behavior, auto events, in-world tag, blips, capture, limits, vehicles, history, notifications and skills. - `server/config_server.lua`: Discord webhooks, the log provider and the export allowlist. Planes, crates, loot tables, zones and flares start from the files in `shared/data`. The in-game admin panel edits them live and saves to the database, which then overrides those files. ## General **shared/config.lua** ```lua Config.Debug = false Config.locale = 'en' Config.UITheme = { preset = 'default', colors = { primary = nil, accent = nil, background = nil, surface = nil, text = nil, }, } Config.InteractionMethod = 'textui' ``` - `Debug`: prints extra diagnostics to the server console. Keep it `false` in production. - `locale`: language code for translations, e.g. `en`. See the `locales/` folder for the codes that ship. - `UITheme.preset`: theme for the loot panel, admin panel and in-world tag. Use `default`, `wasteland`, `cyberpunk`, `noir` or `fantasy`, or `nil` to inherit the global theme. The values in `UITheme.colors` accept CSS hex colors; `nil` inherits the corresponding global color. - `InteractionMethod`: how a landed crate is opened. `textui` shows an `[E]` prompt, `target` uses ox_target. ## Admin **shared/config.lua** ```lua Config.Admin = { AcePermission = nil, Command = 'airdrop', } ``` - `AcePermission`: dedicated ACE permission for the admin panel, e.g. `ml_airdrop.admin`. Leave `nil` to fall back to the ml_bridge permission check. - `Command`: chat command that opens the admin panel. ## Auto Events **shared/config.lua** ```lua Config.AutoEvents = { enabled = true, mode = 'global', interval = { min = 30, max = 45 }, minPlayers = 2, announce = true, countdown = 30, } ``` - `enabled`: run automatic airdrops in the selected mode. Manual and flare drops remain available when this is false. - `mode`: `global` runs one timer using `Config.Defaults`; `zones` runs an independent timer for each enabled zone whose `auto.enabled` is true. Only the selected mode runs. - `interval`: the global timer interval in minutes, chosen between `min` and `max`. Equal values give a fixed interval. Use whole minutes from 1 to 1440, with `min` no greater than `max`. Zone mode uses each zone's own interval. - `minPlayers`: minimum number of online players required for automatic drops. When too few players are online, a due drop waits until the requirement is met. - `announce`: broadcast an incoming-drop notification to everyone. - `countdown`: seconds before the plane appears. In zone mode, the countdown falls within the interval and cannot exceed its duration; after a waiting condition clears, the countdown starts then. Global mode applies the countdown only when `announce` is true, after the interval expires. ## Zone schedules Select `Timers per zone` under `Settings` in the admin panel, or set the mode in the configuration: **shared/config.lua** ```lua Config.AutoEvents.mode = 'zones' ``` Assign automatic settings after the existing zone definitions. This example gives Sandy Shores a fixed 30-minute interval and Grapeseed a random interval of 60 to 90 minutes: **shared/data/zones.lua** ```lua Config.Zones.sandy.auto = { enabled = true, interval = { min = 30, max = 30 }, } Config.Zones.grapeseed.auto = { enabled = true, interval = { min = 60, max = 90 }, } ``` `auto.enabled`: include the zone in automatic scheduling. The zone itself must also be enabled. A zone without an `auto` table does not run its own timer. `auto.interval`: minutes between successful automatic launches in that zone. Use whole minutes from 1 to 1440; `min` must not exceed `max`. Equal values give a fixed interval. Set `crateTypes` and `planeTypes` on the zone to choose its crate and aircraft pools. The first interval starts when the zone timer is activated. Later intervals start when the previous automatic drop is created, as the aircraft goes inbound. They do not start at landing or after looting. If too few players are online, the shared drop limit is reached, or a drop is already active in that zone, the launch waits. Each zone keeps one pending launch; missed intervals do not build a queue of drops. In `Zones`, use `Automatic drops`, `Minimum gap` and `Maximum gap` to edit each timer. `Control` shows `Zone schedules`, the next launch or warning countdown, and any reason a launch is waiting. Saved admin settings override the configuration files. Saving unrelated settings preserves running zone timers; changing a zone interval restarts that timer. Disabling or deleting a zone cancels its pending warning. Resource restarts start fresh intervals and do not catch up on missed launches. ## Defaults **shared/config.lua** ```lua Config.Defaults = { plane = 'cargobob_titan', crate = 'random', zone = 'random', } ``` - `plane`: default aircraft for global automatic events and drops with no aircraft selected. `random` chooses an enabled aircraft. In zone mode, the zone's `planeTypes` takes priority. - `crate`: `random` chooses a weighted crate, or use a specific crate ID. In zone mode, automatic drops use the zone's `crateTypes`. - `zone`: `random` chooses a weighted enabled zone, or use a specific zone ID. Individual zone timers always launch in their own zone. ## In-World Tag **shared/config.lua** ```lua Config.DUI = { enabled = true, maxActive = 6, distance = 30.0, sealDistance = nil, offsetZ = 0.7, scale = 1.0, } ``` - `enabled`: show the floating tag above each crate and vehicle drop. - `maxActive`: how many tags render at once. The nearest drops win when more are active. - `distance`: render distance in meters, fading near the edge. - `sealDistance`: optional larger render distance while a crate is still sealed, so the unlock countdown is readable from farther. `nil` uses `distance`. - `offsetZ`: height of the tag above the crate origin. - `scale`: tag size multiplier. ## Blips **shared/config.lua** ```lua Config.Blips = { plane = { enabled = true, sprite = 424, color = 5, scale = 0.9, label = 'Airdrop Plane' }, crate = { enabled = true, sprite = 478, color = 5, scale = 0.85, label = 'Airdrop' }, zoneRadius = { enabled = true, radius = 120.0, alpha = 70, color = 5 }, } ``` - `plane`: blip for the inbound aircraft while it flies in. - `crate`: blip on the landed crate or vehicle. - `zoneRadius`: search-area circle shown while a drop is inbound. `radius` in meters, `alpha` is its opacity. ## Loot Capture **shared/config.lua** ```lua Config.Capture = { holdTime = 1500, } ``` - `holdTime`: milliseconds a player must hold to capture one loot slot. ## Limits **shared/config.lua** ```lua Config.Limits = { maxConcurrentDrops = 3, locateAttempts = 25, minDistanceFromPlayers = 8.0, } ``` - `maxConcurrentDrops`: server-wide limit shared by automatic, manual, flare and export drops. Automatic warnings also reserve capacity before the drop starts. - `locateAttempts`: candidate points tried before giving up on a zone. - `minDistanceFromPlayers`: a drop point must be at least this far from any player. ## Vehicle Claim **shared/config.lua** ```lua Config.VehicleClaim = { register = true, garage = 'pillboxgarage', claimFuel = 100, } ``` - `register` - `true` registers the claimed vehicle as an owned vehicle. `false` only hands over keys to the spawned vehicle. - `garage`: home garage stored on the owned vehicle. Customise the registration in `open/server.lua`, `OnVehicleClaimed`. - `claimFuel`: fuel level restored once claimed. The vehicle stays at 0 until then. ## History **shared/config.lua** ```lua Config.HistoryRetentionDays = 30 ``` - `HistoryRetentionDays`: days to keep drop history before it is pruned. `0` keeps it forever. ## Notifications **shared/config.lua** ```lua Config.Notifications = { onInbound = true, onLanded = true, } ``` - `onInbound`: toast when an airdrop is inbound. - `onLanded`: toast when an airdrop has landed. ## Skills **shared/config.lua** ```lua Config.Skills = { enabled = false, resource = 'ml_skills', category = 'personal', xp = 25, vehicleXp = 50, } ``` - `enabled`: award XP through ml_skills when a drop is looted or claimed. - `resource`: skills resource name, in case you run a fork. - `category`: default category credited when a crate sets no rewards of its own. It must exist in your ml_skills setup. - `xp`: default container XP budget when a crate sets no rewards. The budget is split across the loot slots, so every player earns for the slots they take. - `vehicleXp`: default XP budget for the player who claims a vehicle drop. A crate can override this with its own rewards, in one or more categories at once, set per crate in the admin panel. ## Minigames **shared/config.lua** ```lua Config.AirdropMiniGames = Config.AirdropMiniGames or {} ``` The minigame registry is filled by the adapter files in `open/minigames`. Add your own there and it becomes selectable as a crate open method. ## Server Config **server/config_server.lua** ```lua Config.DiscordWebhook = { Default = 'INSERT_WEBHOOK_LINK_HERE', Spawn = 'INSERT_WEBHOOK_LINK_HERE', Loot = 'INSERT_WEBHOOK_LINK_HERE', VehicleClaimed = 'INSERT_WEBHOOK_LINK_HERE', Despawn = 'INSERT_WEBHOOK_LINK_HERE', AdminTrigger = 'INSERT_WEBHOOK_LINK_HERE', AdminSave = 'INSERT_WEBHOOK_LINK_HERE', AdminDespawn = 'INSERT_WEBHOOK_LINK_HERE', AdminTeleport = 'INSERT_WEBHOOK_LINK_HERE', } Config.LogProvider = 'discord' Config.AdminExportResources = {} ``` - `DiscordWebhook`: one webhook per action, so each kind of event can go to its own channel. - `LogProvider`: where logs are sent through ml_bridge. One of `discord`, `fivemanage`, `ox_lib`, `both`, `all`. - `AdminExportResources`: resource names allowed to call the `TriggerAirdrop` export. Empty means only ml_airdrop itself can call it. > **TIP:** Disable A Log > > Leave an action on `INSERT_WEBHOOK_LINK_HERE` or empty to disable it. Empty actions fall back to `Default`. --- # AIRDROP: Installation > Setup guide for ML Airdrop Category: AIRDROP · Source: https://miciomods.it/docs/ml-airdrop-installation · Last updated: 2026-07-28 ## Overview ml_airdrop runs a server-controlled supply drop. A plane flies in, a crate parachutes down, and players race to open it and grab the loot slot by slot. Drops run on a timer, from a flare item, from the admin panel, or from another resource. ## Quick Start 1. Download from [CFX Portal](https://portal.cfx.re). 2. Extract to your `resources` folder as `ml_airdrop`. 3. Add it to `server.cfg` after ml_bridge: **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_airdrop ``` > **WARNING:** Load Order > > `ml_airdrop` must start after `ml_bridge`, `ox_lib` and `oxmysql`. ## Database Tables are created automatically on first start. To provision them upfront, run `_INSTALL/schema.sql`. - `ml_airdrop_config`: stores the planes, crates, loot, zones and flares edited in the panel. - `ml_airdrop_history`: stores every past drop and who took what. ## Item Registration Add these to your inventory items file. `crowbar` and `drill` often already exist, so only add what is missing. - `airdrop_flare`: fired by a player to call a drop to their position. - `crowbar`: opens standard containers. - `drill`: opens reinforced containers and vehicle drops. Ready-to-paste definitions are in `_INSTALL/items.lua`. The tools each crate needs are set per crate in the admin panel. ## Open The Panel Type `/airdrop` in chat as an admin to open the panel. From there you trigger drops and edit planes, crates, loot, zones and flares. ## Verify After starting, the console prints: ```bash [ml_airdrop] Resource started ``` **Troubleshooting** - Panel will not open - confirm your account passes the admin check, or set `Config.Admin.AcePermission`. - Nothing drops on a solo test - use the panel and pick "here" so the drop lands at your position, or lower `Config.AutoEvents.minPlayers`. - Crate cannot be opened - the crate needs a tool the player is missing. Check the crate open method in the panel. --- # AIRDROP: Developer > Developer API reference for ML Airdrop Category: AIRDROP · Source: https://miciomods.it/docs/ml-airdrop-developer · Last updated: 2026-08-14 ## Overview Integrate through the `open/` folder, where server, client and shared handlers let you hook the drop lifecycle without touching the core. Two server exports let other resources trigger drops and read the active ones. ## Server Exports - `TriggerAirdrop(spec?)`: starts a drop and returns its uid, or `nil` plus a reason. The calling resource must be listed in `Config.AdminExportResources`. - `GetActiveDrops()`: returns the list of active drops with their state and coordinates. **server.lua** ```lua -- spec fields are all optional local uid, reason = exports.ml_airdrop:TriggerAirdrop({ crateId = 'military', -- omit for the default or a random crate planeId = 'cargobob_titan', zoneId = 'downtown', -- omit for a random zone contested = true, -- false locks the drop to the caller }) ``` ## Server Handlers Located in `open/server.lua`. Return `false` from a `Before` handler to block that step. **open/server.lua** ```lua function OpenServer.BeforeTrigger(src, triggerKind, opts) return true end function OpenServer.OnDropSpawned(drop) end function OpenServer.OnDropLanded(drop) end function OpenServer.ModifyLoot(drop, stock) return stock end function OpenServer.BeforeGiveLoot(src, drop, entry) return true end function OpenServer.OnLootGiven(src, drop, entry) end function OpenServer.BeforeVehicleClaim(src, drop, model) return true end function OpenServer.OnVehicleClaimed(src, payload) end function OpenServer.CanCallFlare(src) return true end function OpenServer.OnDropDespawned(drop, reason) end ``` - `BeforeTrigger`: fires before a drop starts. `triggerKind` is `auto`, `admin`, `flare` or `export`. - `OnDropSpawned` / `OnDropLanded` - fire as the drop goes inbound and when it lands. - `ModifyLoot`: mutate and return the rolled loot before it is locked in. - `BeforeGiveLoot` / `OnLootGiven` - gate and observe each captured slot. - `BeforeVehicleClaim` / `OnVehicleClaimed` - gate and observe a vehicle claim. Register ownership here. - `CanCallFlare`: gate whether a player may call a drop with a flare item. - `OnDropDespawned`: fires on cleanup. `reason` is `emptied`, `expired` or `forced`. ## Client Handlers Located in `open/client.lua`. **open/client.lua** ```lua function OpenClient.BeforeOpenLoot(drop) return true end function OpenClient.AfterLanded(drop) end function OpenClient.AfterOpened(drop) end function OpenClient.AfterCaptureItem(drop, item, count) end ``` - `BeforeOpenLoot`: return `false` to block the loot panel from opening. - `AfterLanded` / `AfterOpened` / `AfterCaptureItem` - observe the lifecycle on this client. > **INFO:** Notifications > > Notifications from every ML script go through `ml_bridge`. `Config.Notify` in `ml_bridge/config.lua` selects the system: auto, ox, qb, esx, wasabi, okok, mythic, pnotify, tnotify, brutal, lation, r_notify, fl, zsx. ## Shared Handlers Located in `open/shared.lua`. **open/shared.lua** ```lua function OpenShared.ResolveId(kind, id) return id end ``` - `ResolveId`: remap a crate, loot, plane or zone id before it is used, for example a seasonal swap. ## Minigames Crate open minigames are adapters in `open/minigames`. Each returns whether the player passed, and registers itself into `Config.AirdropMiniGames`. **open/minigames/_template.lua** ```lua Config.AirdropMiniGames['my_game'] = { label = 'My Minigame', Start = function() -- run your minigame, return true on success return true end, } ``` ## Examples **Call a drop from another resource** List your resource in `Config.AdminExportResources`, then: **server.lua** ```lua exports.ml_airdrop:TriggerAirdrop({ crateId = 'military', contested = true }) ``` **Block drops during a raid event** **open/server.lua** ```lua function OpenServer.BeforeTrigger(src, triggerKind, opts) if MyEvent and MyEvent.active then return false end return true end ``` **Give a bonus when loot is taken** **open/server.lua** ```lua function OpenServer.OnLootGiven(src, drop, entry) -- runs once per captured slot end ``` --- # AIRDROP: F.A.Q > Frequently asked questions for ML Airdrop Category: AIRDROP · Source: https://miciomods.it/docs/ml-airdrop-faq · Last updated: 2026-10-05 ## Setup **How do I change the language?** Set the code in the config. See the `locales/` folder for what ships. **shared/config.lua** ```lua Config.locale = 'it' ``` **How do I open the admin panel?** Type `/airdrop` in chat as an admin. Change the command with `Config.Admin.Command`. **Does it need a database?** Yes. oxmysql is required. The tables are created automatically on first start. ## Drops **How do I change how often drops happen?** Use the global timer for one automatic schedule, or choose independent timers for each zone. Intervals are in minutes; equal minimum and maximum values give a fixed interval. **shared/config.lua** ```lua Config.AutoEvents.mode = 'global' Config.AutoEvents.interval = { min = 30, max = 45 } ``` For separate timers, select `Timers per zone` in `Settings` and configure `Automatic drops`, `Minimum gap` and `Maximum gap` in `Zones`. The same settings can be assigned in the configuration: **shared/config.lua** ```lua Config.AutoEvents.mode = 'zones' ``` **shared/data/zones.lua** ```lua Config.Zones.sandy.auto = { enabled = true, interval = { min = 30, max = 30 }, } ``` **Why is a scheduled drop waiting?** A zone launch waits while the online player requirement is unmet, the shared drop limit is reached, or another drop is active in that zone. The Control tab shows the reason. Each zone keeps one pending launch, so clearing the condition does not produce a backlog of drops. **Are zone timers kept after a restart?** Saved zone settings remain in the database. The countdowns start fresh when the resource restarts; missed launches are not replayed. Editing unrelated settings preserves running timers, while changing a zone interval restarts that timer. **Can a drop be private to one player?** Yes. A drop can be free-for-all or locked to whoever triggered it. Flare-called drops can stay private while world events stay competitive, set per drop. **How do I change what a crate contains?** Edit the loot table in the admin panel. Entries can be items, weapons, cash or bank money, each with a weight, a rarity flag and stack sizes. **How do vehicle drops work?** A vehicle crate rolls one vehicle from a weighted pool and lands it locked and empty. The winner gets it as a registered owned vehicle or with keys, with fuel restored on claim. Set this with `Config.VehicleClaim`. ## Rewards **How does the XP reward work?** When `Config.Skills.enabled` is on, each crate has an XP budget in one or more categories. The budget is split across the loot slots, so every player earns XP for the slots they personally take, not just the first looter. ## Logging **Can each action go to a different Discord channel?** Yes. Each action has its own webhook in `server/config_server.lua`. Set the ones you want and leave the rest empty to fall back to `Default`. ## Updates **How do I update the script?** 1. Download the latest from CFX Portal. 2. Back up your config files. 3. Replace all files except your config. 4. Restart the resource. Your edited planes, crates, loot, zones and flares live in the database, so they are kept across updates. --- # AUTOCAPTURE: Dependencies > Required and optional dependencies for ML Autocapture Category: AUTOCAPTURE · Source: https://miciomods.it/docs/ml-autocapture-dependencies · Last updated: 2026-09-26 ## Required - `screencapture`: Captures the game frame and provides the backward-compatible `screenshot-basic` client exports used by ML Autocapture. - `ox_lib`: Provides commands, callbacks and shared utilities. - `ml_bridge`: Resolves framework administrator permissions and notifications. > **WARNING:** Screen capture resource > > Install and start `screencapture`. Its manifest contains `provide 'screenshot-basic'`, so it satisfies the `screenshot-basic` dependency declared by ML Autocapture. ## Load order **QBox** **server.cfg** ```cfg ensure qbx_core ensure ox_lib ensure ml_bridge ensure screencapture ensure ml_autocapture ``` **QBCore** **server.cfg** ```cfg ensure qb-core ensure ox_lib ensure ml_bridge ensure screencapture ensure ml_autocapture ``` **ESX** **server.cfg** ```cfg ensure es_extended ensure ox_lib ensure ml_bridge ensure screencapture ensure ml_autocapture ``` **Standalone** **server.cfg** ```cfg ensure ox_lib ensure ml_bridge ensure screencapture ensure ml_autocapture ``` ## Optional - `ox_inventory`: Receives clothing and prop icons when their output root is `ox`. Without it, select the self-contained output root. > **INFO:** No database > > ML Autocapture does not use a database. Saved scenes, shots, compositions and sets are stored in `ml_autocapture/data/*.json`. --- # AUTOCAPTURE: Configuration > Configuration reference for ML Autocapture Category: AUTOCAPTURE · Source: https://miciomods.it/docs/ml-autocapture-configuration · Last updated: 2026-09-26 ## General **shared/config.lua** ```lua Config.Language = 'en' Config.Command = 'autocapture' Config.EnableCommand = true Config.AceRestricted = true Config.AcePermission = 'ml_autocapture.use' ``` - `Language`: UI and notification locale. Additional locale files are stored in `locales/`. - `Command`: Chat command registered by the full edition. - `EnableCommand`: Enables the chat command and admin-panel exports. - `AceRestricted`: Requires framework administrator permission or the configured ACE. - `AcePermission`: Additional ACE permission. Set it to an empty string to accept framework administrators only. ## Studio location **shared/config.lua** ```lua Config.RoutingBucket = 970 Config.StudioCoords = vector3(0.0, 0.0, -150.0) Config.StudioHeading = 180.0 Config.StudioAutoRelocate = true Config.StudioClearRadius = 25.0 Config.StudioAltCoords = { vector3(0.0, 0.0, -500.0), vector3(1600.0, 3100.0, -500.0), vector3(2500.0, -350.0, -500.0), } Config.ChromaKeyColor = 'magenta' Config.BackendPort = 3960 ``` - `RoutingBucket`: Private bucket used by studio captures. - `StudioCoords` and `StudioHeading`: Primary hidden studio position and heading. - `StudioAutoRelocate`: Tests the primary location and selects the first clear alternative. - `StudioClearRadius`: Radius checked for map objects around a studio location. - `StudioAltCoords`: Alternative hidden studio positions. - `ChromaKeyColor`: Accepts `magenta` or `green`. - `BackendPort`: Loopback port used by the bundled image processor. ## Capture timing **shared/config.lua** ```lua Config.Capture = { applyWait = 400, settleFrames = 15, settleWait = 0, streamWait = 3000, propWait = 300, batchSize = 10, batchPause = 250, gcEvery = 60, fast = false, captureScale = 3, uploadTimeout = 20000, uploadWait = 1500, } ``` - `applyWait`: Safety delay after applying an item. - `settleFrames`: Rendered frames waited after mounting the camera. Raising it prevents the normal game view from appearing on slow clients. - `settleWait`: Delay after each completed shot. - `streamWait`: Maximum asset streaming wait. - `propWait`: Additional wait for ped props. - `batchSize` and `batchPause`: Periodic pause controls. - `gcEvery`: Garbage-collection interval in shots. Zero disables it. - `fast`: Removes optional timing margins but keeps `settleFrames`. - `captureScale`: Maximum source scale relative to the requested output. Zero captures at game resolution. - `uploadTimeout`: Maximum wait for the backend write confirmation. - `uploadWait`: Fallback delay after repeated missing confirmations. ## Output routing **shared/config.lua** ```lua Config.OutputRoots = { clothing = 'ox', prop = 'ox', vehicle = 'self', outfit = 'self', cinematic = 'self', configurator = 'self', } ``` - `ox`: Writes below `ox_inventory/web/images/`. - `self`: Writes below `ml_autocapture/images/`. The panel can override these defaults for a single run. ## Clothing **shared/config.lua** ```lua Config.Clothing = { size = 256, format = 'png', quality = 92, transparent = true, } Config.CaptureAllTextures = true Config.IncludeDecals = false ``` - `size`: Square output size. - `format`: `png` or `jpg`. - `quality`: JPEG quality from 40 to 100. - `transparent`: Removes the chroma background. - `CaptureAllTextures`: Captures every texture of each drawable. - `IncludeDecals`: Includes clothing component 10. `Config.CameraPresets` stores the framing for each clothing group. Each entry supports `fov`, `zPos`, `rotation`, `dist`, `defaultAngleH`, `defaultCamZ` and `defaultRoll`. `Config.Slots` maps inventory labels to component or prop IDs and their camera preset. ## Props **shared/config.lua** ```lua Config.Props = { enabled = true, autoCamera = true, size = 256, format = 'png', quality = 92, transparent = true, outputKey = 'inventory', pitch = -18.0, yaw = 35.0, margin = 1.35, list = { { item = 'model_windowway_metal', model = 'nc_windowway_metal' }, }, } ``` - `enabled`: Enables the Props tab. - `autoCamera`: Frames each model from its dimensions. - `size`, `format`, `quality` and `transparent`: Prop output settings. - `outputKey`: Output subfolder mapping. - `pitch`, `yaw` and `margin`: Automatic framing defaults. - `list`: Item/model mappings. `item` becomes the filename; `model` is spawned for the capture. ## Vehicles **shared/config.lua** ```lua Config.Vehicles = { enabled = true, autoCamera = true, size = 512, format = 'png', quality = 92, transparent = true, outputKey = 'vehicles', source = 'config', yaw = 35.0, pitch = -8.0, margin = 1.25, primaryColor = nil, secondaryColor = nil, plateText = nil, background = { mode = 'none', color = '#181a21', color2 = '#0b0d12', pad = 0 }, list = {}, } ``` - `source`: Uses the configured list by default. The panel can switch to all spawnable models or a custom list. - `primaryColor`, `secondaryColor` and `plateText`: Optional appearance overrides. - `background.mode`: `none`, solid colour or gradient as selected in the panel. - `background.color`, `color2` and `pad`: Background colours and transparent padding. ## Cinematic presets **shared/config.lua** ```lua Config.Cinematic = { enabled = true, outputKey = 'showcase', width = 1920, height = 1080, format = 'png', quality = 95, watermark = false, bucket = 972, streamWait = 1500, settleWait = 500, clearNearby = true, clearRadius = 90.0, } Config.Naming = { fallback = '{model}_{set}_{shot}' } ``` - `width`, `height`, `format` and `quality`: Default cinematic output. - `watermark`: Applies `images/watermark.png`. - `bucket`: Private bucket used for on-location batches. - `streamWait` and `settleWait`: World and subject settling delays. - `clearNearby` and `clearRadius`: Hide ambient traffic and pedestrians around the shot. - `Naming.fallback`: Default filename pattern. Available placeholders are `{model}`, `{set}`, `{shot}`, `{scene}` and `{index}`. `Config.Scenes` stores locations, environment, lights, depth of field and default framing. `Config.Shots` stores relative camera angles. `Config.Compositions` stores vehicle and ped slots. `Config.Sets` binds a scene, composition, shots and output recipe. These presets can also be created and deleted from the in-game studio. ## Outfit **shared/config.lua** ```lua Config.Outfit = { enabled = true, outputKey = 'showcase', size = 1024, format = 'png', quality = 92, transparent = true, scene = '', fov = 35.0, yaw = 22.0, pitch = -3.0, margin = 1.75, base = {}, poses = {}, outfits = {}, } ``` - `scene`: Empty uses the transparent studio; a scene key uses that location. - `base`: Clothing applied before the showcased item. - `poses`: Animation, scenario or neutral pose definitions. - `outfits`: Optional named complete outfits. ## Configurator **shared/config.lua** ```lua Config.Configurator = { outputKey = 'configurator', width = 0, height = 0, autoCrop = true, cropPadding = 24, maxWidth = 0, threshold = 28, warmupWait = 1000, applyWait = 120, settleWait = 60, batchPause = 0, hero = { yaw = 35.0, pitch = -8.0, fov = 40.0, margin = 1.25 }, paint = { primary = nil, secondary = nil, livery = -1, noPearl = true }, slots = {}, list = {}, } ``` - `width` and `height`: Zero keeps game resolution. - `autoCrop`, `cropPadding` and `maxWidth`: Shared crop controls for every layer. - `threshold`: Difference sensitivity used to isolate vehicle parts. - `warmupWait`, `applyWait`, `settleWait` and `batchPause`: Configurator timing. - `hero`: Locked camera shared by every layer of a vehicle. - `paint`: Optional paint, livery and pearl treatment. - `slots`: Vehicle mod types exposed as configurable layers. - `list`: Default vehicle list. ## Photo mode **shared/config.lua** ```lua Config.Photo = { enabled = true, outputKey = 'photo', width = 1920, height = 1080, format = 'png', quality = 95, privateBucket = true, bucketId = 971, clearNearby = false, clearRadius = 60.0, subjectDefault = 'vehicle', } ``` - `privateBucket` and `bucketId`: Isolate the administrator while composing. - `clearNearby` and `clearRadius`: Default ambient cleanup. - `subjectDefault`: `vehicle` or `ped`. `Config.Photo.camera` controls FOV limits, flight speed and mouse sensitivity. `dof`, `watermark`, `lights`, `grading`, `postfx`, `weathers` and `framing` provide the initial editor presets. ## Studio environment and UI **shared/config.lua** ```lua Config.Studio = { overrideTime = true, hour = 12, minute = 0, overrideWeather = true, weather = 'EXTRASUNNY', lightColor = { r = 255, g = 255, b = 255 }, lightBoost = 1.0, } Config.UITheme = { preset = nil, colors = { primary = nil, accent = nil, background = nil, surface = nil, text = nil }, } ``` - `Studio` fixes time, weather and light colour during transparent captures. - `UITheme.preset` accepts a resource preset or `nil` to inherit the global Micio UI preset. - Each `UITheme.colors` field accepts a CSS hex colour or `nil` to inherit it. --- # AUTOCAPTURE: Installation > Setup guide for ML Autocapture Category: AUTOCAPTURE · Source: https://miciomods.it/docs/ml-autocapture-installation · Last updated: 2026-09-26 ## Overview ML Autocapture creates clothing, prop, vehicle and outfit images inside FiveM. It can produce transparent inventory icons, cinematic batches, free-camera photos and layered vehicle configurator assets. ## Quick Start 1. Download the resource from CFX Portal. 2. Extract it as `ml_autocapture` without renaming the folder. 3. Install `screencapture`, `ox_lib` and `ml_bridge`. 4. Add the resources in this order: **server.cfg** ```cfg ensure ox_lib ensure ml_bridge ensure screencapture ensure ml_autocapture ``` > **WARNING:** Resource name > > The folder must remain named `ml_autocapture`. A different resource name locks the script. ## Access The default command is available to framework administrators and players allowed by the optional ACE permission. **server.cfg** ```cfg add_ace group.admin ml_autocapture.use allow ``` **shared/config.lua** ```lua Config.Command = 'autocapture' Config.EnableCommand = true Config.AceRestricted = true Config.AcePermission = 'ml_autocapture.use' ``` Run `/autocapture` in chat or open the studio from another server resource: ```lua exports['ml_autocapture']:OpenStudio(source) ``` ## Output folders - Clothing with root `ox` writes to `ox_inventory/web/images/clothing/`. - Props with root `ox` write to `ox_inventory/web/images/`. - Self-contained output writes below `ml_autocapture/images/`. - Vehicle configurator layers write below `ml_autocapture/images/configurator/`. > **INFO:** Prop filenames > > Each prop entry has an item name and a model name. The item name becomes the PNG filename. A model named `nc_windowway_metal` mapped to item `model_windowway_metal` produces `model_windowway_metal.png`. ## Headless clothing props On the administrator client used for capture, run this once in the F8 console: ```cfg seta allowEmptyHeadDrawable true ``` Restart ML Autocapture after changing it. Without this client preference, hats, glasses and earrings may include the mannequin head. ## Verify 1. Start all required resources. 2. Confirm the version banner prints without dependency errors. 3. Open `/autocapture` as an administrator. 4. Capture one prop with `Only missing` disabled. 5. Confirm the PNG is written to the selected output root and has transparency. **Troubleshooting** - `screenshot-basic is not started`: Start `screencapture` before ML Autocapture and verify its manifest provides `screenshot-basic`. - The game appears behind the subject: Keep `Config.Capture.settleFrames` at its default or raise it on a slow client. - A prop is skipped: Disable `Only missing`, verify the model resource is started and check that the item/model pair exists in `Config.Props.list`. - The output is written locally: Start `ox_inventory` before ML Autocapture or select the self-contained output root. --- # AUTOCAPTURE: Developer > Developer API reference for ML Autocapture Category: AUTOCAPTURE · Source: https://miciomods.it/docs/ml-autocapture-developer · Last updated: 2026-09-26 ## Overview ML Autocapture exposes server helpers for opening the studio and resolving generated images. The full edition also exposes a client capture function for existing entities. ## Server exports ### Open the studio - `OpenStudio(source)`: Opens the full studio for a real player source. Returns `true` when the request is accepted or `false` when the resource is locked or the source is invalid. ```lua local opened = exports['ml_autocapture']:OpenStudio(source) ``` ### Resolve generated images - `getImage(key)`: Returns a `nui://` URL for the first matching PNG, JPG or WebP in the self-contained output and then `ox_inventory`. Returns `nil` when no image exists. - `getImages(keys)`: Resolves an array of keys and returns a table keyed by the original values. ```lua local url = exports['ml_autocapture']:getImage('model_windowway_metal') local urls = exports['ml_autocapture']:getImages({ 'adder', 'sultan', 'model_windowway_metal' }) ``` ### Vehicle configurator output - `getConfiguratorManifest(model)`: Returns the decoded configurator manifest for a model or `nil`. - `getConfiguratorImage(model, file)`: Returns the `nui://` URL for a generated configurator layer or `nil`. ```lua local manifest = exports['ml_autocapture']:getConfiguratorManifest('adder') local layer = exports['ml_autocapture']:getConfiguratorImage('adder', 'front_bumper_0.png') ``` ## Client exports ### Admin menu integration - `MLAdminPanel()`: Returns the admin-menu label and icon when the command is enabled. - `MLAdminOpen()`: Executes the configured studio command. ```lua local entry = exports['ml_autocapture']:MLAdminPanel() exports['ml_autocapture']:MLAdminOpen() ``` ### Capture an existing entity - `CaptureEntity(entity, key, options?)`: Moves an existing vehicle or ped into the studio, creates a transparent image in the self-contained output, restores the entity and returns its `nui://` URL. Returns `nil` if the studio is busy, the entity is invalid or capture fails. ```lua local url = exports['ml_autocapture']:CaptureEntity(entity, 'preview_vehicle', { width = 512, height = 512, format = 'png', quality = 92, yaw = 35.0, pitch = -8.0, fov = 40.0, margin = 1.25, returnData = false, }) ``` Supported options are `width`, `height`, `format`, `quality`, `yaw`, `pitch`, `fov`, `margin` and `returnData`. ## Client event - `ml_autocapture:entityCaptured`: Fires locally after `CaptureEntity` completes. Parameters are the sanitized key and the resulting URL or `nil`. ```lua AddEventHandler('ml_autocapture:entityCaptured', function(key, url) if not url then return end print(key, url) end) ``` ## File naming Capture keys are converted to lowercase and stripped to letters, digits, underscores and dashes. Prop batches use each entry's `item` value as the key and use `model` only for spawning the object. --- # AUTOCAPTURE: F.A.Q > Frequently asked questions for ML Autocapture Category: AUTOCAPTURE · Source: https://miciomods.it/docs/ml-autocapture-faq · Last updated: 2026-09-21 ## Setup **Which screenshot resource is required?** Install `screencapture` and start it before ML Autocapture. It provides the backward-compatible `screenshot-basic` exports used by the script. **Why does the resource report that screenshot-basic is not started?** The compatibility provider is not active. Verify that the resource folder is named `screencapture`, its manifest contains `provide 'screenshot-basic'`, and it starts before `ml_autocapture`. **Why can a non-admin not open the studio?** Access is restricted by default. Grant framework administrator permission or the optional ACE: **server.cfg** ```cfg add_ace group.admin ml_autocapture.use allow ``` ## Transparent captures **Why is the background black?** Use PNG output with transparency enabled. Restart ML Autocapture after updating it so the current client and backend code are loaded. JPG cannot preserve an alpha channel. **Why does the normal game view appear behind the subject?** The capture was requested before the scripted camera completed enough rendered frames. Keep the default value or raise it on a slow capture client: **shared/config.lua** ```lua Config.Capture.settleFrames = 15 ``` **Why does only the first image have transparency?** Use the current resource files and restart both `screencapture` and `ml_autocapture`. Prop captures always use the configured prop transparency value for the complete batch. ## Props and filenames **Why is nc_windowway_metal missing from the output folder?** It is saved under the item name, not the model name: **shared/config.lua** ```lua { item = 'model_windowway_metal', model = 'nc_windowway_metal' } ``` The resulting file is `model_windowway_metal.png`. **Why was an existing prop not photographed again?** Disable `Only missing`. When enabled, any existing image with the item key is skipped even if it was created by an older run. **Why is a prop counted as skipped?** The entry has no valid item/model pair, an existing image was found while `Only missing` was enabled, or the model was not valid in the client CD image. Start the resource that streams the model before beginning the batch. ## Clothing **Why is a head visible behind hats or glasses?** Enable the client preference on the administrator machine and restart ML Autocapture: ```cfg seta allowEmptyHeadDrawable true ``` Only the client used for capture needs this setting. **Why are decals not included?** They are disabled by default: **shared/config.lua** ```lua Config.IncludeDecals = true ``` ## Output **Where are generated images stored?** The `ox` root writes to `ox_inventory/web/images/`. The `self` root writes to `ml_autocapture/images/`. Clothing and props default to `ox`; vehicles, outfits, cinematic sets and configurator output default to `self`. **Can another resource read generated images?** Yes. Use the server exports: ```lua local image = exports['ml_autocapture']:getImage('adder') local images = exports['ml_autocapture']:getImages({ 'adder', 'sultan' }) ``` ## Updates **How do I update the script?** 1. Back up `shared/config.lua`, `locales/`, `data/` and generated `images/`. 2. Replace the resource files with the current CFX Portal download. 3. Restore only intentional configuration changes. 4. Restart `screencapture` and `ml_autocapture`. 5. Run one transparent prop test with `Only missing` disabled. No database migration is required. --- # BOARDS: Dependencies > Required and optional dependencies for ML Board Category: BOARDS · Source: https://miciomods.it/docs/ml-board-dependencies · Last updated: 2026-08-18 ## Required - [ml_bridge](https://portal.cfx.re): Framework abstraction, inventory operations, target system, notifications - [ox_lib](https://github.com/overextended/ox_lib): Zones, callbacks, points - [oxmysql](https://github.com/overextended/oxmysql): Database driver for board and note persistence ## Framework **QBCore** **server.cfg** ```cfg ensure qb-core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_board ``` **Qbox** **server.cfg** ```cfg ensure qbx_core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_board ``` **ESX** **server.cfg** ```cfg ensure es_extended ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_board ``` **Standalone** **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_board ``` > **INFO:** Auto Detection > > `ml_bridge` detects your framework automatically. No manual setup. ## Optional - `ml_camera`: Lets players pin photos they took in game. Enabled with Config.UseMLCamera - `ox_target` or another target resource: adds context options on the board prop. Without one, boards use a key prompt --- # BOARDS: Configuration > Configuration reference for ML Board Category: BOARDS · Source: https://miciomods.it/docs/ml-board-configuration · Last updated: 2026-07-28 ## Overview Config is split into files: - `shared/config.lua`: General settings, board types, dynamic boards, camera - `shared/config_notes.lua`: Note variants and item requirements - `shared/config_locations.lua`: Static board placements - `server/config_server.lua`: Discord webhook URLs ## General **shared/config.lua** ```lua Config.Locale = 'en' Config.Theme = 'default' Config.Debug = false ``` - `Locale`: Language code for translations - `Theme`: UI theme - `Debug`: Console output. Keep off in production. - `BoardRenderScale`: Board surface sharpness, documented under Board Toolbar ## Defaults Global defaults applied to all boards unless overridden per-location. **shared/config.lua** ```lua Config.Defaults = { RenderDistance = 30.0, ViewDistance = 4.0, EditDistance = 2.0, MaxItems = 15, MaxNotesPerPlayer = 3, CleanupInterval = 30, } ``` - `RenderDistance`: Prop spawn distance (meters) - `ViewDistance`: Distance to read notes - `EditDistance`: Distance to add/remove notes - `MaxItems`: Max notes on a board - `MaxNotesPerPlayer`: Per-player note limit - `CleanupInterval`: Auto-cleanup for expired notes (minutes) ## Note Duration **shared/config.lua** ```lua Config.Duration = { Min = 1, Max = 72, Default = 24, } ``` Notes expire automatically after the configured duration (in hours). ## Items **shared/config.lua** ```lua Config.UseItems = true Config.UseMLCamera = false Config.MLCameraPhotoItem = 'photo' ``` - `UseItems`: If `true`, players need the correct item to place a note (consumed on use) - `UseMLCamera`: Enables photo capture integration - `MLCameraPhotoItem`: Item name for photo notes ## Note Editor Styles offered while a note is being written. **shared/config.lua** ```lua Config.AllowTape = true Config.EditorFonts = { 'hand1', 'hand2', 'marker' } Config.EditorColors = { '#d32f2f', '#222222', '#1565c0', '#2e7d32', '#f9a825', '#6a1b9a' } ``` - `AllowTape`: Offers tape as an alternative to the pushpin when a note is placed - `EditorFonts`: Handwriting styles in the editor. Available: 'hand1' (Caveat), 'hand2' (Shadows Into Light), 'marker' (Permanent Marker), 'hand3' (Patrick Hand) - `EditorColors`: Ink colours in the editor. Any list of hex colours ## Board Toolbar Tools available while looking at a board: move, wire, pen, pen eraser, stamp and eraser. **shared/config.lua** ```lua Config.ToolbarKey = { control = 29, label = 'B' } Config.WireColors = { '#c62828', '#141414', '#1565c0', '#2e7d32' } Config.MaxConnections = 30 Config.PenColors = { '#141414', '#c62828', '#1565c0', '#2e7d32' } Config.AllowNoteDrawing = true Config.BoardRenderScale = 1.5 ``` - `ToolbarKey`: Control id that opens the toolbar and the label shown in the on-screen hint - `WireColors`: Wire colours offered by the wire tool. The first entry is pre-selected - `MaxConnections`: Maximum wires strung on a single board - `PenColors`: Pen colours offered by the drawing tool. The first entry is pre-selected - `AllowNoteDrawing`: Lets anyone who may pin a note also draw on a note. Drawing on the board surface itself follows the 'draw' permission - `BoardRenderScale`: Board surface sharpness, 1.0 to 1.5. Higher is crisper and costs VRAM while a board is open ## Stamps Stamps are pressed onto a note from the toolbar. **shared/config.lua** ```lua Config.Stamps = { { id = 'evidence', label = 'EVIDENCE', color = '#c62828', size = 'medium' }, { id = 'urgent', label = 'URGENT', color = '#c62828', size = 'medium' }, { id = 'verified', label = 'VERIFIED', color = '#2e7d32', size = 'medium' }, { id = 'closed', label = 'CLOSED', color = '#37474f', size = 'medium' }, } Config.StampsRequireItem = false Config.EvidenceTags = true ``` - `id`: Internal key, also stored on the placed stamp - `label`: Text printed on the stamp - `color`: Ink colour - `image`: Optional image URL. Replaces the inked text when set - `size`: Starting size: 'small', 'medium' or 'large'. Resized in game with Shift and the mouse wheel - `StampsRequireItem`: Requires an inventory item to press a stamp - `EvidenceTags`: Numbers every 'evidence' stamp in placement order ## Command **shared/config.lua** ```lua Config.Command = { Enabled = false, Name = 'postit', SkipItemCheck = true, } ``` - `Enabled`: Turns the chat command on - `Name`: Chat command to place a note without targeting a board - `SkipItemCheck`: If `true`, the command bypasses item requirements ## Dynamic Boards Players can place boards from inventory items. **shared/config.lua** ```lua Config.EnableDynamicBoards = true Config.MaxBoardsPerPlayer = 30 Config.BoardPickupPolicy = 'owner' Config.PlacementRaycastDistance = 8.0 ``` - `EnableDynamicBoards`: Lets players place boards from inventory items - `MaxBoardsPerPlayer`: Max boards a player can place - `BoardPickupPolicy`: `'owner'` (only the placer) or `'anyone'` - `PlacementRaycastDistance`: Max placement distance (anti-abuse) ## Board Types Each board type maps an inventory item to a prop model. **shared/config.lua** ```lua Config.BoardTypes = { ['whiteboard_large'] = { item = 'whiteboard_large', prop = 'hei_prop_hei_muster_01', label = 'Large Board', texture = 'trucciolato', replaceTexture = { dict = 'script_rt_planning', name = 'hei_prop_hei_muster_01' }, maxItems = 20, spawnDistance = 75.0, interactionDistance = 3.0, zOffset = -0.5, permissions = { place = 'all', draw = 'own' }, }, ['corkboard'] = { item = 'corkboard', prop = 'bkr_prop_clubhouse_blackboard_01a', label = 'Small Board', texture = 'cork', replaceTexture = { dict = 'prop_blackboard_01', name = 'bkr_prop_clubhouse_blackboard_01a' }, maxItems = 12, spawnDistance = 75.0, interactionDistance = 3.0, zOffset = 0.0, }, ['board_wood'] = { item = 'board_wood', prop = 'dgm_board', label = 'Wooden Board', texture = 'cork', replaceTexture = { dict = 'script_rt_planning', name = 'dgm_board' }, maxItems = 25, spawnDistance = 75.0, interactionDistance = 3.0, zOffset = 0.0, }, } ``` - `prop`: model spawned when a player places the item - `texture`: background key from Config.BoardTextures, so the same prop can read as cork or as a whiteboard - `replaceTexture`: the surface the board is drawn on. `name` is the texture dictionary, which on a stock prop matches the model, and `dict` is the texture inside it. A prop only works as a board if it has one of its own ## Board Textures Selectable backgrounds for board surfaces. **shared/config.lua** ```lua Config.BoardTextures = { { label = 'Cork', value = 'cork', url = '...' }, { label = 'Trucciolato', value = 'trucciolato', url = '...' }, } ``` ## Note Variants Defined in `shared/config_notes.lua`. Each variant specifies a type, required items, and background image. **shared/config_notes.lua** ```lua Config.NoteVariants = { { id = 1, type = 'postit', label = 'Standard Yellow', items = { 'sticky_note', 'sticky_note_yellow' }, image = { 'url1', 'url2' }, }, { id = 2, type = 'photo', label = 'Evidence Photo', items = { 'photo' }, image = 'url', }, { id = 3, type = 'photo', label = 'Wanted Poster', items = { 'photo' }, frame = 'poster_url', ratio = 1.4, window = { x = 18, y = 26, w = 64, h = 42 }, caption = { x = 14, y = 74, w = 72, h = 14 }, }, } ``` - `type`: `'postit'` for text notes, `'photo'` for image notes - `items`: Player needs ANY ONE of these items to place (consumed) - `image`: Background texture. String or array (random selection) - `frame`: Poster artwork drawn around the photo - `window`: Where the photo shows through the artwork, in percent - `caption`: Where the caption is written on the artwork, in percent ## Static Locations Boards placed permanently in the world via `shared/config_locations.lua`. **shared/config_locations.lua** ```lua Config.Locations = { { id = 'police_main_board', model = 'hei_prop_hei_muster_01', coords = vec4(450.30, -979.7, 30.4, 90.0), currentBackground = 'cork', replaceTexture = { dict = 'script_rt_planning', name = 'hei_prop_hei_muster_01' }, -- jobView = nil, -- jobWrite = { 'police', 'sheriff' }, -- jobClear = { 'police' }, permissions = { place = { 'police' }, draw = { 'police' }, clear = { 'police' } }, maxItems = 30, maxPerPlayer = 5, allowedVariants = { 1, 2 }, }, } ``` - `jobView`: `nil` = everyone can read. Table of job names to restrict. - `jobWrite`: Jobs allowed to post notes - `jobClear`: Jobs allowed to clear the board - `allowedVariants`: Restrict which note types are available (by id from `config_notes`) ## Board Permissions Each board sets its own rule per action. Staff with the admin permission bypass every rule. **shared/config_locations.lua** ```lua permissions = { place = 'all', move = 'own', delete = 'own', clear = { 'police' }, connect = 'all', erase_connect = 'own', draw = 'none', erase_draw = 'own', stamp = 'all', }, ``` - `all`: Anyone who can reach the board - `own`: Only the player who put that note, wire or drawing there. On clear, only the board owner - `none`: Staff only - `{ }`: A job list, for example { 'police', 'sheriff' } Actions left out of the table fall back to: place, connect and stamp open to everyone; move, delete, erase_connect and erase_draw limited to your own work; clear reserved to the board owner; draw staff only. The same table is accepted on a board type in Config.BoardTypes, so player-placed boards can be gated the same way. ## Camera Camera framing applied when a player opens a board. `CameraOverrides` is keyed by prop model for per-model adjustments. **shared/config.lua** ```lua Config.CameraDefaults = { offset = vec3(0.0, -1.8, 0.0), yawOffset = 0.0, } Config.CameraOverrides = {} ``` - `offset`: vec3 camera position relative to the board face - `yawOffset`: extra rotation applied to the camera - `CameraOverrides`: per-model overrides keyed by prop model name (empty by default) ## Discord Webhooks **server/config_server.lua** ```lua Config.Log = { NotePlaced = 'INSERT_WEBHOOK_LINK_HERE', NoteDeleted = 'INSERT_WEBHOOK_LINK_HERE', BoardCleared = 'INSERT_WEBHOOK_LINK_HERE', Exploits = 'INSERT_WEBHOOK_LINK_HERE', } ``` Replace each placeholder with a Discord webhook URL. Set to `false` to disable that log entirely. **server/config_server.lua** ```lua Exploits = false, -- disabled, no log sent ``` --- # BOARDS: Installation > Setup guide for ML Board Category: BOARDS · Source: https://miciomods.it/docs/ml-board-installation · Last updated: 2026-07-28 ## Overview ML Board is an interactive whiteboard and corkboard system. Players can view, post notes, and pin photos on boards placed around the map or crafted from inventory items. ## Quick Start 1. Download from [CFX Portal](https://portal.cfx.re) 2. Extract to your `resources` folder as `ml_board` 3. Add to `server.cfg`: **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_board ``` > **WARNING:** Load Order > > `ml_board` must start AFTER `ml_bridge`. Incorrect order causes startup errors. ## Items Setup Copy the contents of `_INSTALL/ox_items.lua` into your `ox_inventory/data/items.lua`. Items included: - Notes: `sticky_note`, `sticky_note_yellow`, `photo` - Boards: `whiteboard_large`, `corkboard`, `board_wood` (the wooden board ships with the resource, no extra prop pack needed) Copy the `.png` images from `_INSTALL/` into your `ox_inventory/web/images/` folder. The folder also carries spare images for notes and boards added later. A note item belongs to a variant in shared/config_notes.lua, a board item to an entry in Config.BoardTypes. > **TIP:** Item Requirement > > If `Config.UseItems = false`, notes can be placed without consuming items. ## Database Tables are created automatically on first start: `ml_boards`: All board state: dynamic player-placed boards and static-location notes (keyed by static_id) `ml_boards`: Any content in this table is imported on first start, then the table is dropped ## Verify Start the server and check for: ```lua [ml_board] Resource started [ml_board] Ensuring ml_boards schema... [ml_board] Schema ready. [ml_board] Loaded 0 dynamic boards. ``` Place a board or use the `/postit` command to test. **Troubleshooting** - Script not starting. Verify all dependencies are running. Check ensure order in `server.cfg`. - Notes not appearing. Ensure DUI is rendering correctly. Check the F8 console for interface errors. - Board prop not spawning. Verify the player is within `RenderDistance` (default 30m). --- # BOARDS: Developer > Developer API reference for ML Board Category: BOARDS · Source: https://miciomods.it/docs/ml-board-developer · Last updated: 2026-07-27 ## Overview ML Board provides server exports for querying board state and handler hooks in the `open/` folder for custom logic. ## Server Exports ```lua local boards = exports['ml_board']:GetActiveBoards() local count = exports['ml_board']:GetPlayerBoardCount(identifier) ``` - `GetActiveBoards()`: Returns a table of all active dynamic (player-placed) boards - `GetPlayerBoardCount(identifier)`: Returns the number of boards owned by a player ## Server Handlers Defined in `open/server.lua`. **open/server.lua** ```lua function OpenServer.CanEditBoard(src, boardId) return true -- return false to block editing end function OpenServer.OnContentSaved(src, boardId) -- Triggered after a note is placed or removed end ``` - `CanEditBoard(src, boardId)`: Called before any edit action. Return `false` to block. - `OnContentSaved(src, boardId)`: Fired after board content changes. Use for logging or syncing. **Restrict Editing to Police Jobs** **open/server.lua** ```lua function OpenServer.CanEditBoard(src, boardId) local job = Bridge.GetJob(src) if job and job.name == 'police' then return true end return false end ``` ## Client Handlers Defined in `open/client.lua`. **open/client.lua** ```lua function OpenClient.OnBoardOpen(boardId) -- Triggered when a player opens a board UI end function OpenClient.OnBoardClose(boardId) -- Triggered when the board UI is closed end ``` - `OnBoardOpen(boardId)`: Use for sounds, effects, or analytics - `OnBoardClose(boardId)`: Cleanup or post-view logic ## Permissions Board access is controlled per-location in `shared/config_locations.lua`, not through handlers: - `jobView`: Jobs that can read the board (`nil` = everyone) - `jobWrite`: Jobs that can post notes - `jobClear`: Jobs that can clear all notes - `allowedVariants`: Restrict which note types are available (by id) Each board also carries a `permissions` table with one rule per action, so pinning, moving, deleting, clearing, wiring, drawing and stamping are gated separately. Static boards take it in shared/config_locations.lua, player-placed boards take it on their entry in Config.BoardTypes. Values are 'all', 'own', 'none' or a job list, and the admin permission bypasses all of them. **shared/config_locations.lua** ```lua permissions = { place = 'all', move = 'own', delete = 'own', clear = { 'police' }, connect = 'all', erase_connect = 'own', draw = 'none', erase_draw = 'own', stamp = 'all', }, ``` --- # BOARDS: F.A.Q > Frequently asked questions for ML Board Category: BOARDS · Source: https://miciomods.it/docs/ml-board-faq · Last updated: 2026-07-28 ## Setup **How do I change the language?** Set `Config.Locale` in `shared/config.lua`: **shared/config.lua** ```lua Config.Locale = 'en' ``` **Why are notes not rendering on the board?** 1. Check the F8 console for DUI errors 2. Verify `web/index.html` and `web/board.html` are present 3. Ensure the board is within `RenderDistance` (default 30m) **Why are items not being consumed?** 1. Verify items from `_INSTALL/ox_items.lua` are in your ox_inventory 2. Check that `Config.UseItems = true` 3. Ensure the note variant's `items` list matches your inventory item names ## Notes **What's the difference between postit and photo?** - `postit`: Text-only notes. Players type a message. - `photo`: Image notes. Requires a photo URL (from `ml_camera` or pasted manually). **How do notes expire?** Notes have a duration set between `Config.Duration.Min` and `Config.Duration.Max` (in hours). When the timer runs out, the note is automatically removed during the next cleanup cycle (`Config.Defaults.CleanupInterval`). **Can I limit which note types are available on a board?** Yes. Set `allowedVariants` in the board's location config. Only note variant IDs in that array will be selectable. **How do players draw on a board?** The pen lives in the board toolbar. Drawing on the board surface follows the draw permission, which is staff only unless a board opens it up: **shared/config_locations.lua** ```lua permissions = { draw = { 'police' } }, ``` Drawing on a note follows the place permission instead, and is on by default: **shared/config.lua** ```lua Config.AllowNoteDrawing = true ``` **How do I add my own stamps?** Add an entry to Config.Stamps. Give it a label and an ink colour, or an image URL to print your own artwork: **shared/config.lua** ```lua Config.Stamps = { { id = 'sealed', label = 'SEALED', color = '#37474f', size = 'medium' }, { id = 'lspd', label = 'LSPD', image = 'https://your.cdn/lspd_stamp.png', size = 'large' }, } ``` **Can a photo sit inside my own poster artwork?** Yes. A photo variant accepts a frame image plus the window the picture shows through and the box the caption is written in, both in percent of the artwork: **shared/config_notes.lua** ```lua { id = 3, type = 'photo', label = 'Wanted Poster', items = { 'photo' }, frame = 'https://your.cdn/wanted_poster.png', ratio = 1.4, window = { x = 18, y = 26, w = 64, h = 42 }, caption = { x = 14, y = 74, w = 72, h = 14 }, } ``` **Do stamps and drawings follow a note when it is moved?** Yes. A stamp pressed on a note and ink drawn across it are stored against that note, so moving or rotating the note carries them along. Deleting the note removes them with it. ## Dynamic Boards **How do player-placed boards work?** Players use a board item (e.g. `whiteboard_small`) from their inventory. They aim at a wall or surface and the board is placed. The board persists in the database until the owner picks it up. **Who can pick up a dynamic board?** Controlled by `Config.BoardPickupPolicy`: - `'owner'`: Only the player who placed it - `'anyone'`: Any player can pick it up ## Locations **How do I add a static board?** Add an entry to `Config.Locations` in `shared/config_locations.lua`: **shared/config_locations.lua** ```lua { id = 'my_board', model = 'hei_prop_hei_muster_01', coords = vec4(x, y, z, heading), currentBackground = 'cork', } ``` Restart the resource after adding locations. **Can I restrict a board to specific jobs?** Yes. Add `jobView`, `jobWrite`, and/or `jobClear` to the location config: ```lua jobView = nil, jobWrite = { 'police', 'sheriff' }, jobClear = { 'police' }, ``` `nil` means everyone. A table restricts to those jobs only. ## Updates **How do I update the script?** 1. Download latest from CFX Portal 2. Backup `shared/config.lua`, `shared/config_notes.lua`, `shared/config_locations.lua`, and `server/config_server.lua` 3. Replace all files except config 4. Restart the resource Board content and dynamic placements are stored in the database, so they survive updates. **Do saved boards need converting?** Boards written by an older release use a different surface layout. The console reports how many are left on start: **server console** ```bash /mlboard_migrate ``` Run it once from the server console, or in game with the admin permission. Boards already converted are skipped. --- # CAMPS: Dependencies > Required and optional dependencies for ML Camps Category: CAMPS · Source: https://miciomods.it/docs/ml-camps-dependencies · Last updated: 2026-08-18 ## Required - ml_bridge (`https://portal.cfx.re`). Framework abstraction: inventory, money, notifications, target zones, permissions, logging - ox_lib (`https://github.com/communityox/ox_lib`). Points (camp enter/exit detection), model loading, table utilities - oxmysql (`https://github.com/communityox/oxmysql`). Database driver for camp definitions, camp state, and panel settings ## Framework **QBCore** **server.cfg** ```cfg ensure qb-core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_camps ``` **Qbox** **server.cfg** ```cfg ensure qbx_core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_camps ``` **ESX** **server.cfg** ```cfg ensure es_extended ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_camps ``` **Standalone** **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_camps ``` > **INFO:** Auto Detection > > `ml_bridge` detects your framework automatically. No manual setup. ## Optional ### Target - `ox_target` or `qb-target`: Loot crates are searched through a target interaction. ml_bridge auto-detects whichever target resource is running. ### Logging - Discord webhooks or FiveManage. Raid logging is delivered through ml_bridge. Configure the provider and the per-channel destinations in `server/config_server.lua`; nothing extra needs to be installed for Discord. --- # CAMPS: Configuration > Configuration reference for ML Camps Category: CAMPS · Source: https://miciomods.it/docs/ml-camps-configuration · Last updated: 2026-07-18 ## Overview - `shared/config/config.lua`: Global settings, raid HUD, loot key, presets, limits, permissions - `shared/config/camps.lua`: Example camps, seeded into the database once on first boot - `shared/config/peds.lua`: Ped models offered by the editor model picker (`pedModelList`) - `shared/config/weaponlist.lua`: Weapons offered by the editor weapon picker (`WeaponsList`) - `server/config_server.lua`: Log channels (Discord webhooks, FiveManage datasets). Never sent to clients Camps are created and edited in-game through the admin panel and stored in the database. The config values below are defaults: the settings modal inside the panel writes HUD and loot-key values to the database, and from then on the saved values win over `Config.HUD` and `Config.LootKey`. ## General **shared/config/config.lua** ```lua Config.Settings = { Locale = 'en', Debug = false, CreatorCommand = 'campsadmin', MoveHudCommand = 'raidhud', SyncRadius = 250.0, UnloadDelay = 120, CombatGrace = 60, CorpseCleanupDelay = 60, SeedExampleCamps = true, BlipsEnabled = true, NotifyOnEnter = true, } Config.Theme = 'default' ``` - `Locale`: Locale key from `locales/*.lua`. See that folder for the shipped files. - `Debug`: Console debug output - `CreatorCommand`: Chat command that opens the admin panel. Permission-gated through `Config.Permissions.Creator` - `MoveHudCommand`: Command any player runs to drag and scale their own raid HUD. Set `''` to disable - `SyncRadius`: Players within this range of a camp receive its peds and live blips - `UnloadDelay`: Seconds with no players inside `SyncRadius` before an active camp despawns back to idle - `CombatGrace`: Seconds after last contact before an engaged camp may reset to full strength - `CorpseCleanupDelay`: Seconds a dead camp ped stays in the world before cleanup - `SeedExampleCamps`: On first boot, if the `ml_camps` table is empty, insert the example camps from `shared/config/camps.lua` - `BlipsEnabled`: Master switch for world map blips - `NotifyOnEnter`: Notify a player when they enter an active camp zone - `Theme`: UI theme: 'default' | 'wasteland' | 'cyberpunk' | 'noir' | 'fantasy' ## Raid HUD **shared/config/config.lua** ```lua Config.HUD = { Enabled = true, Position = 'top-right', ResetVisibilityDefault = 'timer', } ``` - `Enabled`: Master switch for the raid HUD shown while inside a camp radius - `Position`: Default anchor: 'top-right' | 'top-center' | 'left-center' | 'bottom-right'. Each player can override their own position and size with the `MoveHudCommand` command - `ResetVisibilityDefault`: What the HUD shows after a camp is cleared: 'timer' (respawn countdown), 'status' (cleared badge, no countdown), 'hidden' (HUD disappears). 'status' and 'hidden' stop respawn-timer metagaming. Each camp can override this in the editor (Reset Info) > **INFO:** Database Override > > Saving the settings modal in the admin panel writes the HUD values to the `ml_camps_settings` table. From then on the database values are used and pushed live to every player; the config values only act as first-boot defaults. ## Loot Key **shared/config/config.lua** ```lua Config.LootKey = { Mode = 'virtual', Item = 'camp_key', ConsumeOnOpen = true, } ``` - `Mode`: 'virtual' (key tracked server-side, no inventory item) | 'item' (physical inventory item carrying camp metadata; the item must be registered, see the Installation page) - `Item`: Item mode only. Inventory item name handed out as the key - `ConsumeOnOpen`: Remove the key when the holder opens their first crate The key gate is enabled per camp in the editor (**Require key**). A random camp NPC carries the key; when it dies, the key is granted to the nearest raider. If the camp is cleared before the carrier drops it, the first credited raider receives it. One key unlocks every crate of that camp for its holder. In item mode the key carries `metadata.camp`, so it only opens the camp it was looted from. These values can also be changed from the settings modal in the admin panel and are then stored in the database. ## Camp Types **shared/config/config.lua** ```lua Config.CampTypes = { bandit = { label = 'Bandit Camp', blip = { sprite = 84, color = 1, scale = 0.9 } }, military = { label = 'Military Outpost', blip = { sprite = 489, color = 5, scale = 0.9 } }, scavenger = { label = 'Scavenger Den', blip = { sprite = 364, color = 47, scale = 0.9 } }, cartel = { label = 'Cartel Stronghold', blip = { sprite = 51, color = 1, scale = 0.9 } }, } ``` - Presets offered by the editor type field, driving the default blip look. Custom type strings are allowed; every camp can override its blip sprite, color and scale individually - `Config.CrateProps`: Loot crate prop presets ({ model, label }) offered by the editor crate picker. Admins can also type any custom prop model ## Aggression Presets **shared/config/config.lua** ```lua Config.Aggression = { defensive = { combatMovement = 1, combatAbility = 1, useCover = true, canCharge = false }, balanced = { combatMovement = 2, combatAbility = 1, useCover = true, canCharge = false }, aggressive = { combatMovement = 2, combatAbility = 2, useCover = true, canCharge = true }, berserk = { combatMovement = 2, combatAbility = 2, useCover = false, canCharge = true }, } ``` - `combatMovement`: 1 defensive, 2 will advance on the player - `combatAbility`: 1 average, 2 professional - `useCover`: NPC takes cover during firefights - `canCharge`: NPC may rush the player at close range Each NPC group picks one preset by name. Adding a new key here makes it selectable in the editor. ## Stealth **shared/config/config.lua** ```lua Config.Stealth = { crouchRangeMult = 0.55, sprintHearMult = 0.8, detectTicks = 2, alertRadius = 35.0, } ``` - `crouchRangeMult`: Crouched players are seen at this fraction of an NPC's seeing range - `sprintHearMult`: Sprinting players are heard within hearing range multiplied by this value - `detectTicks`: Detection cycles a player must stay in view before an NPC engages. Hearing alone needs one extra tick - `alertRadius`: When one NPC engages, other camp NPCs within this range also alert Shooting inside hearing range, damaging an NPC, or aiming directly at one triggers combat immediately. The per-NPC blip turns from neutral to suspicious to alerted as detection builds. ## NPC Defaults **shared/config/config.lua** ```lua Config.NpcDefaults = { health = 200, armor = 0, accuracy = 35, aggression = 'balanced', detectionRange = 40.0, fovAngle = 110.0, behavior = 'static', weaponMode = 'fixed', weapon = 'WEAPON_PISTOL', } ``` - Fallbacks applied when a camp NPC group omits a field. Field meanings are described under Camp Definition below ## Limits **shared/config/config.lua** ```lua Config.Limits = { maxNpcsPerCamp = 40, maxHealth = 5000, maxArmor = 500, maxRadius = 300.0, maxRaiders = 64, minRespawnDelay = 30, minResetDelay = 30, } ``` - Hard ceilings clamped server-side on every camp definition, including camps saved from the admin panel ## Permissions **shared/config/config.lua** ```lua Config.Permissions = { Creator = { useDefaultAdmins = true, ace = { 'ml_camps.creator', 'admin', 'god', 'superadmin', 'command', 'group.admin', 'group.superadmin' }, }, LiveActions = { useDefaultAdmins = true, ace = { 'ml_camps.admin', 'admin', 'god', 'superadmin', 'group.admin', 'group.superadmin' }, }, } ``` - `Creator`: Opens the admin panel, creates/edits/deletes camps, changes global settings - `LiveActions`: Force clear, force reset and teleport from the Live tab - `useDefaultAdmins`: Also accept anyone ml_bridge recognizes as a server admin - `ace`: ACE permissions accepted for the tier. Grant a single group with e.g. `add_ace group.mod ml_camps.creator allow` Permission checks are implemented in `open/handlers_server.lua` and can be replaced with custom logic. See the Developer page. ## Camp Definition Camps are normally built in the editor; the fields below are what the editor produces and what `shared/config/camps.lua` seeds on first boot. After the first boot the database is the source of truth and the file is no longer read. **shared/config/camps.lua** ```lua Config.Camps['bandit_grapeseed'] = { id = 'bandit_grapeseed', label = 'Grapeseed Bandit Camp', type = 'bandit', enabled = true, center = { x = 2447.0, y = 4968.0, z = 45.5 }, radius = 60.0, respawnEnabled = true, respawnDelay = 1800, resetDelay = 600, maxRaiders = 6, hud = { resetVisibility = 'inherit' }, blip = { enabled = true, sprite = 84, color = 1, scale = 0.9, showRadius = true }, npcs = { ... }, loot = { ... }, } ``` - `id`: Unique key, letters/numbers/underscore only - `type`: A `Config.CampTypes` key or any custom string - `enabled`: Disabled camps keep their data but never spawn - `center` / `radius`: The camp zone. A player crossing the radius activates the camp and is tracked as a raider - `respawnEnabled`: `false` makes the camp spawn-once: after a clear it goes to `depleted` and stays empty until a staff Force Reset - `respawnDelay`: Seconds a cleared camp stays on cooldown before it can spawn again - `resetDelay`: Seconds before an engaged-but-not-cleared camp respawns to full strength (combined with `Config.Settings.CombatGrace`) - `maxRaiders`: Players eligible for loot credit on clear, ordered by who entered the zone first - `hud.resetVisibility`: Per-camp override of the HUD reset info: 'inherit' | 'timer' | 'status' | 'hidden' - `blip`: Map blip. `showRadius` draws the zone circle. The blip color follows the live camp status ### NPC groups **shared/config/camps.lua** ```lua npcs = { { modelPool = { 'g_m_y_lost_01', 'g_m_y_lost_02', 'g_m_y_lost_03' }, count = 4, weaponMode = 'fixed', weapon = 'WEAPON_PISTOL', health = 200, armor = 0, accuracy = 30, aggression = 'balanced', detectionRange = 40.0, behavior = 'patrol', spawnMode = 'auto', }, } ``` - `model` / `modelPool`: Single ped model, or a pool one is picked from per spawn. Custom addon peds are allowed - `count`: NPCs spawned from this group - `weaponMode`: 'fixed' uses `weapon`, 'random' picks from `weaponPool` per spawn - `health` / `armor` / `accuracy`: Combat stats, clamped by `Config.Limits` - `aggression`: A `Config.Aggression` preset name - `detectionRange` / `fovAngle`: Seeing and hearing range in meters, and field of view in degrees - `behavior`: 'static' (holds position), 'patrol' (walks `patrolPoints` in order, or wanders the area when none are set), `'guard'` (defends a `guardRadius` around its spawn) - `spawnMode`: 'auto' scatters spawns around the camp center, 'fixed' cycles through `spawnPoints` - `patrolPoints`: The route a patrol NPC walks, in order, looping back to the start, placed in-game from the editor. Each waypoint carries a type: a `pass-through` point only shapes the walk, a `stop` parks the NPC there for a set number of seconds, and a `random stop` pauses it on some laps and walks it past on others. Cycle the type with `R` as you drop each point, or change it per point in the list. Random-stop odds default to `Config.NpcDefaults.patrolStopChance`, and a point with no set duration falls back to `patrolWaitDefault`. A stop, or a random stop when it fires, can also face a heading you set with the mouse wheel as you place it, so a paused guard looks where you want. ### Loot **shared/config/camps.lua** ```lua loot = { rewardType = 'both', delivery = 'prop', requireKey = false, props = { { model = 'prop_box_ammo04a' }, }, fixedLoots = { { items = { 'bandage' }, min = 1, max = 2 }, }, probabilityLoots = { loop = 3, items = { { items = { 'lockpick' }, min = 1, max = 1, probability = 40.0 }, { items = { 'weapon_pistol' }, min = 1, max = 1, probability = 8.0 }, }, }, moneyConfig = { account = 'cash', min = 200, max = 600 }, } ``` - `rewardType`: 'money' | 'items' | 'both' - `delivery`: 'direct' pays everything straight into eligible raiders' inventories on clear. 'prop' and 'both' put items into lootable crates while money is still paid directly on clear. When no crates are defined, items fall back to direct delivery - `requireKey`: Enables the loot key gate for this camp (see Loot Key above) - `props`: One lootable crate per entry. Optional `coords` (placed in-world from the editor); without coords crates spawn near the camp center. Each crate yields a full loot roll to the first eligible raider who searches it - `fixedLoots`: Guaranteed drops. Each entry picks one item from `items` and rolls `min`: `max` of it. Optional `itemMetadata` per item - `probabilityLoots`: Random tables. The whole set is rolled `loop` times (max 10); each group drops with `probability` percent per roll - `moneyConfig`: Account 'cash' or 'bank', random amount between `min` and `max` (capped at 100000) > **WARNING:** Item Names > > Every item name used in loot tables must exist in your inventory, or that drop is silently skipped. The editor item picker only offers registered items. ## Log Channels **server/config_server.lua** ```lua Config.Logs = { Enabled = true, Provider = 'discord', -- 'discord' | 'fivemanage' | 'ox_lib' | 'both' | 'all' Channels = { Activated = { webhook = '', dataset = 'ml_camps_activated' }, Cleared = { webhook = '', dataset = 'ml_camps_cleared' }, Loot = { webhook = '', dataset = 'ml_camps_loot' }, Key = { webhook = '', dataset = 'ml_camps_key' }, Reset = { webhook = '', dataset = 'ml_camps_reset' }, Despawn = { webhook = '', dataset = 'ml_camps_despawn' }, CampEdit = { webhook = '', dataset = 'ml_camps_campedit' }, LiveActions = { webhook = '', dataset = 'ml_camps_live' }, Settings = { webhook = '', dataset = 'ml_camps_settings' }, }, } ``` - `Enabled`: Master switch for all logging - `Provider`: 'discord' (webhooks), 'fivemanage' (datasets), 'ox_lib' (server console), 'both' (Discord + FiveManage), 'all' - `Activated`: A camp was activated (raid started) - `Cleared`: A camp was cleared, with the credited raider list - `Loot`: A player claimed loot from a crate, with the exact items and money - `Key`: A camp key was granted to a player - `Reset`: A camp reset to full strength - `Despawn`: A camp despawned with no players nearby - `CampEdit`: Staff created, edited or deleted a camp - `LiveActions`: Staff force clear, force reset or teleport - `Settings`: Staff changed the global HUD or key settings - `Exploit`: A player failed a server-side check (out-of-range activate/loot, or an unauthorized admin call) Each channel has its own webhook and its own FiveManage dataset. Leave a webhook empty to silence that channel on Discord, or point several channels at the same webhook for fewer destinations. --- # CAMPS: Installation > Setup guide for ML Camps Category: CAMPS · Source: https://miciomods.it/docs/ml-camps-installation · Last updated: 2026-07-09 ## Overview ML Camps adds raidable NPC camps with a full server-side lifecycle: a camp sits idle until a player walks in, spawns its defenders, tracks the fight, pays out loot on clear, and respawns on a cooldown. Camps are created and managed entirely in-game through an admin panel with a map view, a live overview and per-NPC group editing. Loot is delivered directly or through lockable crates, optionally gated behind a camp key carried by one of the defenders. ## Quick Start - Download from CFX Portal (`https://portal.cfx.re`) - Extract to your `resources` folder as `ml_camps` - Add to `server.cfg`: **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_camps ``` > **WARNING:** Load Order > > `ml_camps` must start AFTER `ml_bridge`. ## Database Tables are created automatically on first start. No manual SQL import is needed; `_INSTALL/ml_camps.sql` ships the same schema for reference. - `ml_camps`: One row per camp definition (the admin panel writes here) - `ml_camp_state`: Camp status and respawn timestamp, so cooldowns and depleted camps survive restarts - `ml_camps_settings`: Global HUD and loot-key settings saved from the panel > **INFO:** Example Camps > > On first boot, with `Config.Settings.SeedExampleCamps = true` and an empty `ml_camps` table, two example camps are seeded into the database. Move, edit or delete them freely from the panel. ## Item Registration No items are required by default. The loot key runs in `'virtual'` mode out of the box and tracks the key server-side. Only if you switch `Config.LootKey.Mode` (or the panel setting) to `'item'`, register the key item from `_INSTALL/items.lua`: **ox_inventory/data/items.lua** ```lua ['camp_key'] = { label = 'Camp Key', weight = 100, stack = false, close = true, description = 'A key looted from a camp defender. Opens the stash of the camp it came from.', }, ``` Loot table items are your own: every item name configured in a camp loot table must already exist in your inventory. ## Verify After starting, the console prints: ```bash __ ____________________ __ _______ ___ ____ / |/ / _/ ___/ _/ __ \/ |/ / __ \/ _ \/ __/ / /|_/ // // /___/ // /_/ / /|_/ / /_/ / // /\ \ /_/ /_/___/\___/___/\____/_/ /_/\____/____/___/ ML Camps - Raidable NPC Camps System -------------------------------------------------- [ml_camps] Resource started [ml_camps] Developed by Micio Mods | miciomods.it -------------------------------------------------- [ml_camps] [INFO] ml_camps server ready ``` In game, run `/campsadmin` (default command) as an admin to open the panel. Walking into a camp radius spawns its NPCs and shows the raid HUD. **Troubleshooting** - `/campsadmin` does nothing. Missing Creator permission. Grant an ACE from `Config.Permissions.Creator` (e.g. `add_ace group.admin ml_camps.creator allow`) or rely on the default admin detection - No camps anywhere. The `ml_camps` table is empty and `SeedExampleCamps` is `false`. Create a camp from the panel - No blips on the map. Check `Config.Settings.BlipsEnabled` and the per-camp Show Blip toggle - NPCs do not spawn. Invalid ped model. The console warns `Model "x" not in CDImage`; a camp that spawns 0 NPCs returns to idle - Loot items never drop. The item names in the loot tables must exist in your inventory; unknown items are skipped - Key never appears in item mode. Register `camp_key` (the console prints an error pointing to `_INSTALL/items.lua`), or switch the key mode back to 'virtual' - Camp stays cleared forever. Spawn-once camps (`respawnEnabled = false`) stay depleted by design. Use Force Reset in the Live tab to restock them --- # CAMPS: Developer > Developer API reference for ML Camps Category: CAMPS · Source: https://miciomods.it/docs/ml-camps-developer · Last updated: 2026-07-05 ## Overview Integration runs through three server exports, replicated GlobalState keys any resource can read, and handler hooks in the `open/` folder (shipped unescrowed). ## Server Exports - `GetCampStatus(campId)`: Returns the runtime status string, or nil for an unknown camp: 'idle' | 'active' | 'combat' | 'cleared' | 'cooldown' | 'depleted' - `IsCampCleared(campId)`: Returns true while the camp status is 'cleared' or 'cooldown'. Spawn-once camps report 'depleted' instead; check `GetCampStatus` for those - `GetCampAliveCount(campId)`: Number of hostiles still alive ```lua local status = exports.ml_camps:GetCampStatus('bandit_grapeseed') local cleared = exports.ml_camps:IsCampCleared('bandit_grapeseed') local alive = exports.ml_camps:GetCampAliveCount('bandit_grapeseed') ``` ## GlobalState Every camp replicates a live snapshot under `mlcamp_`, readable on both sides: ```lua local snap = GlobalState['mlcamp_bandit_grapeseed'] -- { -- status = 'combat', -- idle | active | combat | cleared | cooldown | depleted -- alive = 3, -- hostiles alive -- total = 6, -- hostiles spawned -- nextRespawn = 0, -- unix timestamp when the cooldown ends, 0 otherwise -- } ``` The active raid HUD settings are replicated under `mlcampcfg` as `{ enabled, position, resetVisibilityDefault }`. Camp NPCs carry `mlCampPed = true` and `mlCampId` on their entity state bag, so other scripts can recognize them. ## Server Handlers Located in `open/handlers_server.lua`. **open/handlers_server.lua** ```lua Handlers.HasCreatorPermission = function(source) -- return true to allow the admin panel end Handlers.HasLivePermission = function(source) -- return true to allow force clear / force reset / teleport end Handlers.OnCampActivated = function(campId, campData) end Handlers.OnCampCleared = function(campId, campData, raiders) -- raiders: array of credited server ids, entry order end Handlers.ModifyLoot = function(campId, items, money) return items, money end ``` - `HasCreatorPermission` / `HasLivePermission`: Permission gates for the two staff tiers. The default implementation checks `Config.Permissions` through ml_bridge; replace it to plug in any permission system - `OnCampActivated`: Fires when a camp spawns its NPCs - `OnCampCleared`: Fires when the last hostile dies. `raiders` holds the credited player ids - `ModifyLoot`: Called before every loot payout (direct and per crate). Return the modified `items` array (`{ name, count, metadata? }`) and `money` table (`{ account, amount }` or nil) ## Client Handlers Located in `open/handlers_client.lua`. **open/handlers_client.lua** ```lua Handlers.CanShowCampBlip = function(campId, campData) return true -- return false to hide this camp's blip for the local player end Handlers.OnCampEntered = function(campId, campData) end ``` - `CanShowCampBlip`: Per-player blip filter, evaluated when camps load - `OnCampEntered`: Fires when the local player crosses into a camp radius ## Examples **Reward every raider on clear** **open/handlers_server.lua** ```lua Handlers.OnCampCleared = function(campId, campData, raiders) for _, src in ipairs(raiders) do Bridge.GiveItem(src, 'water', 1) end end ``` **Scale loot by camp type** **open/handlers_server.lua** ```lua Handlers.ModifyLoot = function(campId, items, money) local camp = Config.Camps[campId] if camp and camp.type == 'military' and money then money.amount = math.floor(money.amount * 1.5) end return items, money end ``` **Gate content behind a cleared camp** **your_script/server.lua** ```lua RegisterNetEvent('myscript:enterBunker', function() local src = source if not exports.ml_camps:IsCampCleared('military_zancudo') then Bridge.NotifyPlayer(src, 'error', 'Clear the outpost first.') return end -- open the bunker end) ``` **React to camp status changes (client)** **your_script/client.lua** ```lua AddStateBagChangeHandler(nil, 'global', function(_, key, value) if type(key) ~= 'string' or key:sub(1, 7) ~= 'mlcamp_' then return end local campId = key:sub(8) if value and value.status == 'cleared' then print(('camp %s cleared near %s'):format(campId, tostring(cache.ped))) end end) ``` **Detect camp NPCs from another script (client)** **your_script/client.lua** ```lua local function isCampNpc(ped) return Entity(ped).state.mlCampPed == true end -- e.g. skip camp NPCs in a ped-scanning loop for _, ped in ipairs(GetGamePool('CPed')) do if ped ~= cache.ped and not isCampNpc(ped) then -- safe to process end end ``` --- # CAMPS: F.A.Q > Frequently asked questions for ML Camps Category: CAMPS · Source: https://miciomods.it/docs/ml-camps-faq · Last updated: 2026-09-26 ## Setup **How do I change the language?** Set `Config.Settings.Locale` in `shared/config/config.lua`. See the `locales/` folder. **shared/config/config.lua** ```lua Config.Settings.Locale = 'en' ``` **How do I create a camp?** Run `/campsadmin` and press New Camp. Set the center with "Add my position", the in-world 3D placement, or by clicking the Map tab; add NPC groups and loot; save. The camp is written to the database immediately and goes live for every player without a restart. **Who can open the admin panel?** Anyone passing the `Config.Permissions.Creator` check: a default admin recognized by ml_bridge, or any of the listed ACE permissions. Force clear, force reset and teleport in the Live tab use the separate `LiveActions` tier. **Can I edit camps in the config file instead?** `shared/config/camps.lua` is only seeded into the database once, on first boot with an empty `ml_camps` table. After that the database is the source of truth and the file is no longer read, edit camps from the panel. ## Camps & Respawn **How does a raid start?** A camp sits idle with no NPCs in the world. The first player to cross its radius activates it: defenders spawn with their configured loadouts and behaviors, the status flips to active, and to combat while players are inside. Everyone within `Config.Settings.SyncRadius` sees the same fight. **What happens if the raiders run away mid-fight?** After `Config.Settings.CombatGrace` seconds without contact and once the camp has been up for its `resetDelay`, the survivors are restocked to full strength. If nobody stays within `SyncRadius` for `UnloadDelay` seconds, the camp despawns entirely and returns to idle. **How does respawn work after a clear?** A cleared camp enters cooldown for `respawnDelay` seconds, then returns to idle and can be raided again. Cooldowns are persisted in the `ml_camp_state` table and survive server restarts. **What is a spawn-once camp?** A camp with respawns turned off in the editor (`respawnEnabled = false`). After a clear it goes to `depleted` and stays empty until staff press Force Reset in the Live tab. Useful for one-time story locations or manually restocked world bosses. **Can players sneak past the NPCs?** Yes. Detection uses line of sight, field of view, seeing and hearing ranges. Crouching shrinks the distance NPCs see you at, sprinting makes noise, and an NPC needs to keep you in view for `Config.Stealth.detectTicks` cycles before engaging. When one NPC engages, nearby NPCs within `alertRadius` join in. ## Loot & Keys **When can the loot crates be opened?** Crates spawn when the camp activates, but stay locked while any hostile is alive ("Defeat all enemies first."). Once the camp is cleared, only the raiders who took part in the fight, up to `maxRaiders`, ordered by who entered first, can open them. **How do crate claims work between raiders?** Each crate is claimed by the first eligible raider who searches it and then disappears for everyone. Every crate yields its own full roll of the camp loot tables, so more crates means more total loot. **What is the difference between 'direct', 'prop' and 'both' delivery?** 'direct' pays the loot roll straight into every eligible raider's inventory the moment the camp clears. 'prop' and 'both' put items into the lootable crates instead, while money is still paid directly on clear. If a camp has no crates defined, items fall back to direct delivery. **How does the loot key work?** Enable **Require key** on a camp in the editor. One random defender carries the key; killing that NPC grants it to the nearest raider. If the camp is cleared before the carrier dies, the first credited raider gets it. One key unlocks all of that camp's crates for its holder, and with `ConsumeOnOpen` it is spent on the first crate. **What is the difference between 'virtual' and 'item' key mode?** 'virtual' (default) tracks the key server-side, no inventory item to register. 'item' hands out a physical inventory item (`camp_key` by default) carrying `metadata.camp`, so it only opens the camp it was looted from. Item mode requires registering the item from `_INSTALL/items.lua`. The mode is switched globally from the panel settings or `Config.LootKey.Mode`. **What happens when a raider's inventory is full?** The overflow is dropped on the ground at the player and a warning notification is shown. This applies to loot and to the key item in item mode. ## Raid HUD **What does the raid HUD show?** While inside a camp radius: the camp name and type, hostiles alive over total with a kill bar, the camp status, and, after a clear, the respawn countdown, a cleared badge, or nothing, depending on the reset visibility setting. **How do players move or resize the HUD?** With the `/raidhud` command (configurable via `Config.Settings.MoveHudCommand`): drag to move, scroll to resize, Enter to save, Esc to cancel. The position is saved per player on their client. **How do I hide the respawn timer from players?** Set the reset visibility to 'status' (cleared badge, no countdown) or 'hidden' (HUD disappears after the clear) in the panel settings, that is the global default, or override it per camp in the editor. Hiding the timer stops players from camping respawns by the clock. **Can I disable the HUD entirely?** Yes, toggle it off in the panel settings (or ship `Config.HUD.Enabled = false`). The change replicates to every online player immediately. ## Updates **How do I update the script?** - Download latest from CFX Portal - Backup `shared/config/`, `server/config_server.lua` and `open/` - Replace all files except those - Restart the resource Camps, camp states and panel settings live in the database and survive updates. The console prints a notice when a newer version is available, and the admin panel shows the changelog. --- # CLIMATIC VITALS: Dependencies > Required and optional dependencies for ML Climatic Vitals Category: CLIMATIC VITALS · Source: https://miciomods.it/docs/ml-climaticvitals-dependencies · Last updated: 2026-09-26 ## Required - [ml_bridge](https://portal.cfx.re): Item registration, inventory checks, survival stats, notifications, login detection - [ox_lib](https://github.com/overextended/ox_lib): Keybinds (`lib.addKeybind`), zones (`lib.zones`), progress bars (`lib.progressBar`), cache system - [oxmysql](https://github.com/overextended/oxmysql): Database persistence for temperature state. Only required when `Config.EnableDB = true` ## Framework **QBCore** **server.cfg** ```cfg ensure qb-core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_climaticvitals ``` **Qbox** **server.cfg** ```cfg ensure qbx_core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_climaticvitals ``` **ESX** **server.cfg** ```cfg ensure es_extended ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_climaticvitals ``` **Standalone** **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_climaticvitals ``` > **INFO:** Auto Detection > > `ml_bridge` detects your framework automatically. No manual setup. ## Optional ### Weather Systems Any weather script that changes the native GTA weather works without direct integration. `ml_climaticvitals` reads weather via `GetPrevWeatherTypeHashName()` on the client. Compatible with: - vSync - qb-weathersync - cd_easytime - renewed-weathersync - Any script that calls `SetWeatherTypeNow`, `SetWeatherTypeOverTime`, or similar natives --- # CLIMATIC VITALS: Configuration > Configuration reference for ML Climatic Vitals Category: CLIMATIC VITALS · Source: https://miciomods.it/docs/ml-climaticvitals-configuration · Last updated: 2026-07-09 ## Overview - `shared/config.lua`: All settings in a single file Weather temperature values define the "ambient" temperature. The "perceived" temperature is what the player feels after all modifiers stack. ## General **shared/config.lua** ```lua Config.Debug = false Config.Locale = 'en' Config.ForceShowWidget = true Config.DefaultUnit = 'C' Config.RequiredItem = false Config.Widget = { DefaultScale = 1.0, -- Initial scale for new players (0.5 = half, 2.0 = double) LockPosition = false, -- Force one position+scale for every player LockedLeft = '25px', -- CSS left when locked (px or %) LockedTop = '25px', -- CSS top when locked (px or %) LockedScale = 1.0, -- Scale when locked } ``` - `Debug`: Prints state info to console. Enables the `/tempclothes` debug command - `Locale`: Language code for translations - `ForceShowWidget`: When `true` (the default), the temperature HUD stays visible even when `ml_hud` or other scripts try to hide it via the `hideweatherhud` export - `DefaultUnit`: Default temperature unit. `'C'` for Celsius, `'F'` for Fahrenheit. Players can toggle with `/tempunit`; their choice persists via KVP - `RequiredItem`: Item name required in inventory to see the HUD. Set to `false` for always visible. Example: `'survival_watch'` - `Widget.DefaultScale`: Initial HUD scale for new players. `1.0` = normal, `0.5` = half, `2.0` = double - `Widget.LockPosition`: When `true`, every player sees the HUD at the locked position/scale below and `/movetempui` is disabled - `Widget.LockedLeft` / `Widget.LockedTop`: CSS `left`/`top` position when locked (px or %) - `Widget.LockedScale`: HUD scale applied when `LockPosition = true` ## Commands **shared/config.lua** ```lua Config.Commands = { moveUI = 'movetempui', toggleUnit = 'tempunit', hideHud = 'hidetemphud', debugClothes = 'tempclothes', } ``` - `moveUI`: Opens drag mode to reposition the HUD widget. Press ESC to save and exit - `toggleUnit`: Toggles between Celsius and Fahrenheit. Persists per player via KVP - `hideHud`: Toggles the temperature HUD on/off - `debugClothes`: Prints current clothing drawable IDs and thermal bonuses to F8 console. Only active when `Config.Debug = true` ## Sync & Persistence **shared/config.lua** ```lua Config.SyncInterval = 30000 Config.EnableDB = true Config.ForceLoadOnRestart = true Config.ForceLoadTimer = 1000 Config.RequireGameplayReadyGate = false ``` - `SyncInterval`: Milliseconds between server temperature sync cycles. Keep at 30000 or higher - `EnableDB`: Save temperature to database between restarts. Requires `oxmysql` - `ForceLoadOnRestart`: Force player state reload when the resource restarts mid-session - `ForceLoadTimer`: Delay in ms before checking player state on resource restart - `RequireGameplayReadyGate`: Optional spawn gate. Leave `false` (default) and the system starts on the framework player-load event (`Bridge.IsPlayerLoaded`), which works standalone with no extra dependency. Set `true` only if your spawn resource (e.g. `ml_start`) sets the player's `gameplayReady` state after spawn; the HUD then waits for that signal instead ## Temperature & Weather **shared/config.lua** ```lua Config.DefaultTemperature = 22.0 Config.MinTemperature = -35.0 Config.MaxTemperature = 55.0 Config.MaxTempChangePerCycle = 0.1 Config.TempVariation = 0.05 ``` - `DefaultTemperature`: Starting temperature when the database is empty or disabled - `MinTemperature`: Absolute minimum temperature - `MaxTemperature`: Absolute maximum temperature - `MaxTempChangePerCycle`: Maximum degrees the ambient temperature shifts per sync cycle. Lower = smoother transitions - `TempVariation`: Random fluctuation added each cycle ### Weather Map **shared/config.lua** ```lua Config.WeatherTemperature = { ["EXTRASUNNY"] = { base = 32.0, min = 28.0, max = 38.0 }, ["CLEAR"] = { base = 26.0, min = 20.0, max = 32.0 }, ["SMOG"] = { base = 28.0, min = 22.0, max = 34.0 }, ["NEUTRAL"] = { base = 22.0, min = 15.0, max = 25.0 }, ["CLOUDS"] = { base = 18.0, min = 12.0, max = 22.0 }, ["CLEARING"] = { base = 20.0, min = 15.0, max = 24.0 }, ["OVERCAST"] = { base = 16.0, min = 10.0, max = 20.0 }, ["RAIN"] = { base = 14.0, min = 8.0, max = 18.0 }, ["THUNDER"] = { base = 12.0, min = 6.0, max = 16.0 }, ["FOGGY"] = { base = 10.0, min = 5.0, max = 15.0 }, ["SNOWLIGHT"] = { base = 0.0, min = -5.0, max = 5.0 }, ["SNOW"] = { base = -4.0, min = -10.0, max = 2.0 }, ["XMAS"] = { base = -6.0, min = -12.0, max = 0.0 }, ["BLIZZARD"] = { base = -15.0, min = -30.0, max = -5.0 }, ["HALLOWEEN"] = { base = 13.0, min = 5.0, max = 20.0 }, } ``` Each weather type defines: - `base`: Target temperature the system drifts towards - `min` / `max`: Range within which temperature fluctuates These are ambient temperatures. Perceived temperature differs based on all player-specific modifiers. ## Damage & Survival **shared/config.lua** ```lua Config.EnableDamageSystem = true Config.DamageInterval = 15000 ``` - `EnableDamageSystem`: Apply health damage at extreme temperatures - `DamageInterval`: Milliseconds between damage ticks ### Thresholds & Values **shared/config.lua** ```lua Config.DamageThresholds = { hot = 42.0, cold = -5.0 } Config.DamageValues = { hot = 5, cold = 5 } ``` - `DamageThresholds.hot`: Perceived temperature above this triggers heatstroke damage - `DamageThresholds.cold`: Perceived temperature below this triggers hypothermia damage - `DamageValues.hot`: Health points removed per tick from heat - `DamageValues.cold`: Health points removed per tick from cold ### Status Degradation **shared/config.lua** ```lua Config.StatusDamage = { Enabled = true, HungerRemoveCold = 2.0, ThirstRemoveCold = 0.5, HungerRemoveHot = 0.5, ThirstRemoveHot = 4.0 } ``` - `Enabled`: Drain hunger/thirst at extreme temperatures - `HungerRemoveCold`: Hunger drain per tick in cold (body burns calories) - `ThirstRemoveCold`: Thirst drain per tick in cold - `HungerRemoveHot`: Hunger drain per tick in heat - `ThirstRemoveHot`: Thirst drain per tick in heat (sweating) Status damage is computed server-side from config values (zero-trust). Client sends only the condition string (`'hot'`/`'cold'`), server applies a 10-second per-player rate limit. ### Visual Effects **shared/config.lua** ```lua Config.EnableVisualEffects = true Config.Intensity = { start = 0.2, max = 0.8, increment = 0.05 } ``` - `EnableVisualEffects`: Show screen vignette effects at extreme temperatures - `Intensity.start`: Initial effect intensity when entering danger zone - `Intensity.max`: Maximum intensity cap (0.8 keeps gameplay usable) - `Intensity.increment`: How much intensity increases per damage tick ## Wetness & Water **shared/config.lua** ```lua Config.EnableWetnessSystem = true Config.Wetness = { IncreaseRate = 0.05, DecreaseRate = 0.005, HeatSourceDryRate = 0.08, TemperatureMalus = -8.0, ExposedVehicleClasses = { [8] = true, -- Motorcycles [13] = true, -- Cycles [14] = true, -- Boats } } ``` - `IncreaseRate`: How fast the player gets wet in rain - `DecreaseRate`: Normal drying rate - `HeatSourceDryRate`: Drying rate near fire/heat sources - `TemperatureMalus`: Perceived temperature penalty at 100% wetness. Scales linearly - `ExposedVehicleClasses`: Vehicle classes that do not protect from rain ### Swimming **shared/config.lua** ```lua Config.PlayerOnWater = { Enabled = true, TempMalus = -15.0, WetnessIncrease = 0.05 } ``` - `Enabled`: Apply temperature penalty when swimming - `TempMalus`: Instant perceived temperature reduction while in water - `WetnessIncrease`: Wetness increase rate while swimming ## Vehicle Climate Control ### Keybind **shared/config.lua** ```lua Config.Keybinds = { climateControl = { defaultKey = 'J', description = 'Open Vehicle Climate Control' } } ``` - `defaultKey`: Default key to open climate panel. Rebindable via FiveM keybind settings - `description`: Label shown in FiveM keybind menu ### Climate Settings **shared/config.lua** ```lua Config.VehicleClimate = { defaultTemp = 21.0, defaultMode = 'auto', minTemp = 16.0, maxTemp = 28.0, tempChangeStep = 0.5, efficiency = 1.0, dryingBonus = 0.08 } ``` - `defaultTemp`: Default target temperature - `defaultMode`: Default mode: `'auto'`, `'heat'`, or `'ac'` - `minTemp`: Minimum settable temperature - `maxTemp`: Maximum settable temperature - `tempChangeStep`: Temperature step per click - `efficiency`: Climate control effectiveness. `1.0` = fast. Lower = slower - `dryingBonus`: Extra drying speed when heater is active ### Blacklist **shared/config.lua** ```lua Config.VehicleClimateBlacklist = { classes = { [8] = true, -- Motorcycles [13] = true, -- Cycles [14] = true, -- Boats [21] = true -- Trains }, models = { [`caddy`] = true, [`tractor`] = true } } ``` - `classes`: Vehicle classes without climate control - `models`: Specific vehicle model hashes without climate control ## Climate UI Themes **shared/config.lua** ```lua Config.ClimateThemes = { default = 'utility', classes = { [0] = 'utility', -- Compacts [1] = 'utility', -- Sedans [2] = 'utility', -- SUVs [3] = 'utility', -- Coupes [4] = 'retro', -- Muscle [5] = 'retro', -- Sports Classics [6] = 'minimal', -- Sports [7] = 'luxury', -- Super [9] = 'utility', -- Off-road [10] = 'utility', -- Industrial [11] = 'utility', -- Utility [12] = 'utility', -- Vans [14] = 'utility', -- Boats [15] = 'utility', -- Helicopters [16] = 'utility', -- Planes [17] = 'utility', -- Service [18] = 'utility', -- Emergency [19] = 'utility', -- Military [20] = 'utility', -- Commercial [21] = 'utility', -- Trains [22] = 'minimal' -- Open Wheel }, models = { [`torero`] = 'retro', [`zentorno`] = 'luxury', [`faggio`] = 'retro', [`neon`] = 'luxury', [`raiden`] = 'luxury', [`cyclone`] = 'luxury', [`voltic`] = 'luxury', [`tezeract`] = 'luxury', [`omnisegt`] = 'luxury' } } ``` Available themes: `'utility'`, `'minimal'`, `'luxury'`, `'retro'` - `default`: Theme when no class or model match is found - `classes`: Theme per vehicle class ID - `models`: Theme override per model hash. Takes priority over class ## Interior Bonus **shared/config.lua** ```lua Config.InteriorBonus = { targetTemp = 22.0, strength = 0.5, } ``` - `targetTemp`: Target temperature inside MLOs/interiors - `strength`: Pull strength towards the target. `0.0` = no effect, `1.0` = full pull to target temperature. At `0.5`, the perceived temperature moves halfway between current and target Works both ways, warms the player when it's cold outside, cools when it's hot. ## Temperature Objects **shared/config.lua** ```lua Config.TemperatureObjects = { ['prop_beach_fire'] = { radius = 12.0, bonus = 15.0, dynamic = true, force = 1.0 }, ['prop_hobo_stove_01'] = { radius = 6.0, bonus = 10.0, dynamic = true, force = 1.0 }, ['gr_prop_gr_hobo_stove_01'] = { radius = 6.0, bonus = 10.0, dynamic = true, force = 1.0 }, ['prop_rub_tyre_01'] = { radius = 8.0, bonus = 12.0, dynamic = true, force = 1.0 }, ['prop_fan_01'] = { radius = 4.0, bonus = -4.0, dynamic = true, force = 2.0 }, ['v_res_coolingfan'] = { radius = 4.0, bonus = -3.0, dynamic = true, force = 2.0 }, } ``` Each entry defines a GTA prop that radiates heat or cold: - `radius`: Detection range in game units - `bonus`: Temperature modifier. Positive = heat, negative = cold - `dynamic`: Scale bonus by distance (closer = stronger). When `false`, flat bonus within radius - `force`: Falloff exponent. Higher = steeper falloff near the edge ## Vehicle Insulation **shared/config.lua** ```lua Config.VehicleModifiers = { excludeCategories = { 8, 13 }, categoryBonus = { [0] = 3, -- Compact [1] = 4, -- Sedan [2] = 5, -- SUV [18] = 4, -- Emergency }, hashBonus = { [`rhino`] = 10, [`firetruk`] = 8, } } ``` - `excludeCategories`: Vehicle classes with zero insulation (bikes, cycles) - `categoryBonus`: Perceived temperature bonus per vehicle class - `hashBonus`: Bonus override for specific vehicle model hashes ## Zones & Blips ### Blip Settings **shared/config.lua** ```lua Config.BlipSettings = { sprite = 441, color = { hot = 1, cold = 3, neutral = 2 }, scale = 0.8, shortRange = true, } ``` - `sprite`: Map blip sprite ID - `color`: Blip color IDs for hot, cold, and neutral zones - `scale`: Blip size - `shortRange`: Only show blip when nearby ### Temperature Zones **shared/config.lua** ```lua Config.TemperatureZones = { { type = 'poly', modifier = -10.0, points = { vec3(...), vec3(...), ... }, thickness = 20.0, dynamic = true, debug = false, showNotification = true, showBlip = false, blipName = "Freezing Zone" }, { type = 'box', modifier = 15.0, coords = vec3(1093.1, -1999.5, 31.0), size = vec3(20.0, 20.0, 10.0), rotation = 0, dynamic = true, debug = false, showNotification = true, showBlip = false, blipName = "Heat Zone" } } ``` - `type`: Zone shape: `'poly'`, `'box'`, or `'sphere'` - `modifier`: Temperature offset. Positive = hotter, negative = colder - `points`: Array of vec3 vertices (poly type) - `coords`: Center position (box/sphere types) - `size`: Dimensions vec3 (box type) - `radius`: Detection radius (sphere type) - `rotation`: Box rotation in degrees - `thickness`: Vertical thickness (poly type) - `dynamic`: Scale modifier by distance from center (box/sphere) - `debug`: Draw zone boundaries (ox_lib debug) - `showNotification`: Notify player on enter/exit - `showBlip`: Add a map blip at the zone - `blipName`: Label for the map blip ## Usable Items **shared/config.lua** ```lua Config.ItemBuffs = { ['coffee'] = { buff = 8.0, duration = 10, notification = "item_buff_bag", progressBar = { duration = 5000, label = 'Drinking Coffee...', useWhileDead = false, canCancel = true, disable = { move = false, car = true, combat = true }, anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' }, prop = { model = `prop_fib_coffee`, pos = vec3(0.01, 0.01, -0.06), rot = vec3(5.0, 5.0, -180.5) } } }, ['water'] = { buff = -5.0, duration = 5, notification = "item_buff_icecream", progressBar = { duration = 3000, label = 'Drinking Water...', useWhileDead = false, canCancel = true, disable = { move = false, car = true, combat = true }, anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' }, prop = { model = `prop_ld_flow_bottle`, pos = vec3(0.03, 0.03, 0.02), rot = vec3(0.0, 0.0, -1.5) } } }, } ``` Each item entry: - `buff`: Temperature modifier in degrees. Positive = warming, negative = cooling - `duration`: Buff duration in minutes - `notification`: Locale key for the notification on buff activation - `progressBar`: ox_lib progressBar config: `duration` (ms), `label`, `useWhileDead`, `canCancel`, `disable`, `anim`, `prop` Items are registered as usable via `Bridge.BindUsableItem` on server start. The flow is: server triggers client → client runs progress bar → on completion, client sends `confirmItemUse` back to server → server verifies inventory, removes item, applies buff. ## Clothing Thermal Bonus **shared/config.lua** ```lua Config.ClothesBonus = { ["male"] = { ["hat"] = { [3] = 1, [5] = 1, ... }, ["torso"] = { [17] = 8, [34] = 6, ... }, ["pants"] = { [4] = 2, [31] = 2, ... }, ["shoes"] = { [12] = 2, [14] = 1, ... }, ["tops"] = { [466] = 2, [497] = 7, [15] = -2, [16] = -2 }, ["undershirt"] = {}, ["armor"] = {}, ["decals"] = {}, }, ["female"] = { ["hat"] = {}, ["torso"] = {}, ["pants"] = {}, ["shoes"] = {}, ["undershirt"] = {}, ["armor"] = {}, ["decals"] = {}, ["tops"] = {} } } ``` Maps ped drawable variation IDs to temperature bonuses per clothing slot: - Positive values = warmth (jackets, boots, winter hats) - Negative values = cooling (tank tops, light shirts) - Keys are the drawable variation index from `GetPedDrawableVariation` - Slots map to ped component IDs: `hat` (0), `torso` (3), `pants` (4), `shoes` (6), `tops` (11), etc. > **TIP:** Debug Clothes > > Enable `Config.Debug` and use `/tempclothes` in-game to see every drawable ID and its thermal bonus for the current ped. --- # CLIMATIC VITALS: Installation > Setup guide for ML Climatic Vitals Category: CLIMATIC VITALS · Source: https://miciomods.it/docs/ml-climaticvitals-installation · Last updated: 2026-08-18 ## Overview `ml_climaticvitals` tracks a server-wide ambient temperature based on the current GTA weather. Each player gets a "perceived" temperature that shifts based on what they're wearing, whether they're in a vehicle, near a fire, inside an MLO, wet from rain, in a temperature zone, etc. When perceived temp hits extreme values, the player takes health damage and loses hunger/thirst faster. Vehicles with the engine running have a climate control panel with 4 selectable themes. A draggable HUD widget shows ambient and perceived temperature. ## Quick Start 1. Download from [CFX Portal](https://portal.cfx.re) 2. Extract to your `resources` folder as `ml_climaticvitals` 3. Add to `server.cfg`: **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_climaticvitals ``` > **WARNING:** Load Order > > `ml_climaticvitals` must start AFTER `ml_bridge` and `oxmysql`. > **WARNING:** Resource Name > > The resource folder must be named exactly `ml_climaticvitals`. The script validates this on startup and prints a critical error if mismatched. ## Database Tables are created automatically on first start: `ml_climaticvitals`: Stores the current server temperature (single row). Persists temperature across restarts when Config.EnableDB = true > **TIP:** Disable DB > > Set `Config.EnableDB = false` to run without a database. Temperature resets to `Config.DefaultTemperature` on each restart. ## Verify After starting, the console prints the resource banner: ```lua [ml_climaticvitals] Resource started [ml_climaticvitals] Developed by Micio Mods | miciomods.it ``` The temperature HUD widget appears after the player loads in. Use `/movetempui` to reposition it, `/hidetemphud` to toggle visibility. **Troubleshooting** - HUD not showing, ensure the player is fully loaded. Check `Config.RequiredItem` if set to an item name (HUD only shows when the item is in inventory) - Temperature stuck, the system waits for the first weather report from a client. At least one player must be connected - Database errors, verify `oxmysql` is started and the database connection is working - Resource name error in console, rename the resource folder to exactly `ml_climaticvitals` - Climate control not opening, check that the vehicle engine is running and the vehicle class is not in `Config.VehicleClimateBlacklist` --- # CLIMATIC VITALS: Developer > Developer API reference for ML Climatic Vitals Category: CLIMATIC VITALS · Source: https://miciomods.it/docs/ml-climaticvitals-developer · Last updated: 2026-07-09 ## Overview `ml_climaticvitals` has client exports for reading temperature data and toggling the system, plus `open/` folder with empty OpenClient/OpenServer tables reserved for your own code. Vehicle climate state syncs via entity StateBags. Server-side: temperature calculation, weather sync, DB persistence, item confirmation (zero-trust, server computes all damage/stat values, never trusts client). ## Client Exports ### Temperature Data - `GetPerceivedTemperature()`: Returns the current perceived temperature (number, Celsius). Includes all modifiers - `GetCurrentTemperature()`: Returns the current ambient/server temperature (number, Celsius). Raw weather-based value - `GetState()`: Returns a table with the full system state: ```lua { perceived = 22.0, -- Perceived temperature (Celsius) current = 20.0, -- Ambient temperature (Celsius) weather = 'CLEAR', -- Current weather type string nearHeat = false, -- Near a heat/cold source object inVehicle = false, -- In a vehicle with insulation inInterior = false, -- Inside an MLO/interior wetness = 0.0, -- Wetness level (0.0 to 1.0) itemBuff = 0.0, -- Active item buff modifier } ``` ### UI Control - `hideweatherhud(hide)`: Hide or show the temperature HUD widget. `true` = hide, `false` = show. Blocked when `Config.ForceShowWidget = true` - `HideUi(shouldHide)`: Alias for `hideweatherhud` - `OpenClimateMenu()`: Opens the vehicle climate control UI. Only works in a valid vehicle with the engine running ### System Control - `SetClimaticState(state)`: Enable or disable the entire system. `true` = active, `false` = paused. When paused: HUD hides, visual effects clear, damage stops, temperature updates stop ### Buffs - `ApplyBuff(buffAmount, durationMinutes)`: Apply a local temperature buff. `buffAmount` is degrees (positive = warm, negative = cool), `durationMinutes` is duration in minutes. Client-side only, does not sync to server ## StateBags ### Vehicle Climate State Climate control state is stored on the vehicle entity: ```lua Entity(vehicle).state.climateState = { on = true, -- Climate system on/off temp = 21.0, -- Target temperature fan = 1, -- Fan speed level (0-3) mode = 'auto' -- 'auto', 'heat', or 'ac' } ``` All vehicle occupants read this StateBag. The driver sends updates to the server via `ml_climaticvitals:server:updateClimateState`. The server validates: entity existence, player proximity (10 units), data types, and clamps temp/fan/mode to valid ranges before writing the StateBag. ## Server Events - `ml_climaticvitals:getInitialTemperature`: Client requests current temperature on join - `ml_climaticvitals:server:setWeather`: Weather reporter client sends the current weather name. Accepted only from the assigned reporter - `ml_climaticvitals:server:updateClimateState`: Client sends vehicle climate changes. Server validates before writing StateBag - `ml_climaticvitals:server:ApplyStatusDamage`: Client sends condition string (`'hot'`/`'cold'`). Server computes actual hunger/thirst values from config and applies them via `Bridge.SetHunger`/`Bridge.SetThirst`. Rate-limited to 10 seconds per player - `ml_climaticvitals:server:confirmItemUse`: Client confirms item consumption after progress bar completes. Server verifies inventory, removes 1 item, applies buff via client event. Protected with `GetInvokingResource()` check ## Client Events - `ml_climaticvitals:updateTemperature`: Server broadcasts ambient temperature and weather type - `ml_climaticvitals:client:setAsWeatherReporter`: Server assigns a client as weather reporter - `ml_climaticvitals:client:useItem`: Server triggers item consumption flow. Client shows progress bar, then confirms back to server - `ml_climaticvitals:client:applyBuff`: Server applies a buff after item confirmation. Receives `buffAmount` and `durationMs` - `ml_climaticvitals:client:notifyItemBuff`: Server sends item notification after confirmation - `ml_climaticvitals:client:playerReady`: Internal event fired when the player is fully loaded All `RegisterNetEvent` handlers include `GetInvokingResource()` checks to prevent server-side event spoofing. ## Temperature Calculation The perceived temperature formula: ```lua basePerceived = ambient + zoneModifier + clothesThermalBonus + temperatureObjectBonus + vehicleClimateModifier + vehicleInsulationBonus + nightTimeMalus (-4 between 21:00-06:00) + wetnessMalus (wetness * Config.Wetness.TemperatureMalus) + waterMalus (Config.PlayerOnWater.TempMalus when swimming) + itemBuff interiorMod = (Config.InteriorBonus.targetTemp - basePerceived) * Config.InteriorBonus.strength perceived = basePerceived + interiorMod ``` The interior mod pulls perceived temp towards `targetTemp`: warms you if it's cold, cools you if it's hot. ## Weather Reporter System One client is designated as the weather reporter and polls `GetPrevWeatherTypeHashName()` every 5 seconds. When the reporter disconnects, the server reassigns after 1 second. Only the assigned reporter's weather updates are accepted. ## Item Use Flow 1. Server registers all `Config.ItemBuffs` items as usable via `Bridge.BindUsableItem` 2. Player uses item → server checks `Bridge.HasItem` → triggers `ml_climaticvitals:client:useItem` 3. Client shows `lib.progressBar` with animation/prop 4. On progress bar completion → client triggers `ml_climaticvitals:server:confirmItemUse` 5. Server re-checks `Bridge.HasItem`, removes 1 item, triggers buff on client Item is removed server-side only after client confirms progress bar completion. Cancelling the progress bar does not remove the item. ## Examples **Read Temperature from Another Script** ```lua -- Client-side local state = exports.ml_climaticvitals:GetState() print(('Perceived: %.1f, Weather: %s, Wetness: %.0f%%'):format( state.perceived, state.weather, state.wetness * 100 )) ``` **Hide HUD During Cutscenes** ```lua -- Client-side exports.ml_climaticvitals:hideweatherhud(true) -- hide exports.ml_climaticvitals:hideweatherhud(false) -- show ``` **Pause System During Minigame** ```lua -- Client-side exports.ml_climaticvitals:SetClimaticState(false) -- pause -- ...minigame logic... exports.ml_climaticvitals:SetClimaticState(true) -- resume ``` **Apply a Local Buff from Another Script** ```lua -- Client-side: cool the local player by 10 degrees for 5 minutes exports.ml_climaticvitals:ApplyBuff(-10.0, 5) ``` --- # CLIMATIC VITALS: F.A.Q > Frequently asked questions for ML Climatic Vitals Category: CLIMATIC VITALS · Source: https://miciomods.it/docs/ml-climaticvitals-faq · Last updated: 2026-07-28 ## Setup **How do I change the language?** **shared/config.lua** ```lua Config.Locale = 'en' ``` **Do I need oxmysql?** Only if `Config.EnableDB = true` (default). With the database enabled, the server temperature persists across restarts. Set `Config.EnableDB = false` to run without it, temperature resets to `Config.DefaultTemperature` on each restart. **Does it work with my weather script?** Yes. The system reads GTA's native weather state via `GetPrevWeatherTypeHashName()`. Any script that changes the game weather (vSync, qb-weathersync, cd_easytime, renewed-weathersync, etc.) works without any integration. **How do I require an item to see the HUD?** Set `Config.RequiredItem` to an inventory item name: **shared/config.lua** ```lua Config.RequiredItem = 'survival_watch' ``` The HUD only appears when the player has the item in inventory. Set to `false` for always visible. **How do I add a new temperature item?** Add an entry to `Config.ItemBuffs` in `shared/config.lua`: **shared/config.lua** ```lua ['hot_chocolate'] = { buff = 6.0, duration = 8, notification = "item_buff_bag", progressBar = { duration = 4000, label = 'Drinking Hot Chocolate...', useWhileDead = false, canCancel = true, disable = { move = false, car = true, combat = true }, anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' }, prop = { model = `prop_fib_coffee`, pos = vec3(0.01, 0.01, -0.06), rot = vec3(5.0, 5.0, -180.5) } } }, ``` The item name must match the inventory item name. Registered as usable automatically on resource start. **How do I add clothing thermal values?** Edit `Config.ClothesBonus` in `shared/config.lua`. Enable `Config.Debug` and use `/tempclothes` in-game to see each drawable ID and its current bonus: **shared/config.lua** ```lua Config.ClothesBonus["male"]["torso"][17] = 8 -- heavy jacket = +8 warmth Config.ClothesBonus["male"]["tops"][15] = -2 -- light t-shirt = -2 cooling ``` ## Temperature **What is the difference between ambient and perceived temperature?** Ambient is the raw weather-based value calculated by the server. Perceived is what the player feels, ambient plus all modifiers: clothing, vehicle insulation, interior bonus, wetness, fire/AC proximity, zones, items, night time, and vehicle climate control. **How does the interior bonus work?** Instead of a flat offset, the interior bonus pulls perceived temp towards `Config.InteriorBonus.targetTemp` (default 22.0). The `strength` controls how hard it pulls, at `0.5`, perceived temp moves halfway to the target. So if it's freezing outside, being indoors warms you up; if it's scorching, indoors cools you down. **How does night time affect temperature?** Between 21:00 and 06:00 (game time), a flat -4 degree penalty is applied to perceived temperature. **How does wetness work?** Players get wet from rain (when not sheltered, in an interior, or in a closed vehicle) and from swimming. Wetness scales from 0.0 to 1.0. At 100% wetness, `Config.Wetness.TemperatureMalus` (-8.0 by default) is applied. Drying is faster near heat sources or with the vehicle heater active. **When does damage start?** Health damage starts when perceived temperature exceeds `Config.DamageThresholds.hot` (42.0) or drops below `Config.DamageThresholds.cold` (-5.0). Damage ticks every `Config.DamageInterval` ms (15s). Hunger and thirst also drain, computed server-side with a 10-second per-player rate limit. ## Vehicle Climate **How do I open the climate control panel?** Press `J` (default) while in a vehicle with the engine running. The vehicle must not be blacklisted. Rebindable in FiveM keybind settings. **How are themes assigned to vehicles?** Priority: model override > vehicle class > default. Available themes: `'utility'`, `'minimal'`, `'luxury'`, `'retro'`. **Can I disable climate control for specific vehicles?** Add the vehicle class to `Config.VehicleClimateBlacklist.classes` or the model hash to `Config.VehicleClimateBlacklist.models`: **shared/config.lua** ```lua Config.VehicleClimateBlacklist.models[`golf`] = true ``` ## Zones **How do I create a temperature zone?** Add an entry to `Config.TemperatureZones`. Three shapes available: **shared/config.lua** ```lua -- Sphere { type = 'sphere', modifier = -12.0, coords = vec3(x, y, z), radius = 50.0, dynamic = true, debug = false, showNotification = true, showBlip = true, blipName = "Ice Lake" } -- Box { type = 'box', modifier = 15.0, coords = vec3(x, y, z), size = vec3(20, 20, 10), rotation = 0, dynamic = true, debug = false, showNotification = true, showBlip = false, blipName = "Foundry" } -- Polygon { type = 'poly', modifier = -10.0, points = { vec3(...), vec3(...), ... }, thickness = 20.0, dynamic = true, debug = false, showNotification = true, showBlip = false, blipName = "Mountain" } ``` Set `debug = true` to visualize zone boundaries during testing. ## Integration **How do I hide the HUD from another script?** ```lua exports.ml_climaticvitals:hideweatherhud(true) -- hide exports.ml_climaticvitals:hideweatherhud(false) -- show ``` If `Config.ForceShowWidget = true`, hide requests are blocked. **How do I pause the system during a minigame?** ```lua exports.ml_climaticvitals:SetClimaticState(false) -- pause everything exports.ml_climaticvitals:SetClimaticState(true) -- resume ``` ## Updates **How do I update the script?** 1. Download latest from CFX Portal 2. Backup `shared/config.lua` and `open/*.lua` 3. Replace all files except config and open folder 4. Restart the resource The database table uses `CREATE TABLE IF NOT EXISTS`: no migration needed. The script checks for updates on startup and prints the changelog if a new version is available. --- # CRAFTING: Dependencies > Required and optional resources for ml_crafting Category: CRAFTING · Source: https://miciomods.it/docs/ml-crafting-dependencies · Last updated: 2026-09-26 ## Required - [ml_bridge](https://portal.cfx.re): Framework abstraction, inventory operations, usable items, permissions, notifications, logging - [ox_lib](https://github.com/communityox/ox_lib): Callbacks, model and animation loading - [oxmysql](https://github.com/communityox/oxmysql): Database driver for stations, recipes, blueprints, queue and player progression ## Framework **QBCore** **server.cfg** ```cfg ensure qb-core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_crafting ``` **Qbox** **server.cfg** ```cfg ensure qbx_core ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_crafting ``` **ESX** **server.cfg** ```cfg ensure es_extended ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_crafting ``` **Standalone** **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ml_bridge ensure ml_crafting ``` > **INFO:** Auto Detection > > `ml_bridge` detects your framework automatically. ## Optional ### Progression - ml_skills: Skill gating and XP rewards. Recipes can require an unlocked skill or a level, stay hidden until the skill is learned, and pay XP into the ml_skills tree with automatic category routing. Configured through `Config.ExternalSkills` ### Fuel - ml_fuel: Refuel benches with reusable jerrycans. With `Config.Fuel.mlFuel.enabled`, any item carrying `fuelAmount` and `fuelType` metadata is treated as a fuel container: it is kept in the inventory and only emptied, never consumed ### Other - ml_vehiclecraft: When started, the recipe editor can list buildable vehicles from it - ml_hud: The shipped `open/client.lua` contains a sample stress call wired to ml_hud, wrapped in a safe call. Remove or replace it freely --- # CRAFTING: Configuration > Every config option in ml_crafting explained Category: CRAFTING · Source: https://miciomods.it/docs/ml-crafting-configuration · Last updated: 2026-08-14 ## Overview - `shared/config.lua`: Global behavior, language, theme, interaction ranges, features, progression, blueprints, portable stations, fuel and durability defaults - `shared/config_models.lua`: Station model presets, bench prop, screen texture placement, per-model camera - `server/config_server.lua`: Discord webhooks Stations, recipes, categories, blueprints and custom station models are not defined in the config. They live in the database and are built from the in-game admin panel (`/craftadmin`). Where the same setting exists in both places, fuel, durability, pickup rules, queue limits, the value saved in the admin panel takes priority over the config default. ## General **shared/config.lua** ```lua Config.Debug = false Config.Language = 'en' Config.Theme = 'default' Config.MainColor = nil Config.Command = 'craftadmin' ``` - `Debug`: Console output for troubleshooting - `Language`: Locale code, must match a file in `locales/`. - `Theme`: Interface theme: `'default'`, `'wasteland'`, `'cyberpunk'`, `'noir'`, `'fantasy'` - `MainColor`: Hex accent color override. `nil` uses the theme default. Individual benches can override it again with a tint color from the admin panel - `Command`: Chat command that opens the admin editor ## Interaction & Streaming **shared/config.lua** ```lua Config.Interaction = { TargetDistance = 2.5, SpawnDistance = 80.0, DuiActivation = 12.0, MaxOperationRange = 5.0, } Config.Stream = { Radius = 200.0, OutRadius = 250.0, ReloadDistance = 100.0, PollMinInterval = 1500, PollMaxInterval = 4000, } ``` - `TargetDistance`: Range in meters to interact with a bench - `SpawnDistance`: Distance at which bench props spawn and despawn - `DuiActivation`: Distance at which the screen content starts rendering - `MaxOperationRange`: Server-side maximum distance for any crafting action. Requests from further away are rejected - `Radius` / `OutRadius`: Benches inside `Radius` enter the client cache, benches beyond `OutRadius` drop from it. Keep `OutRadius` larger than `Radius` - `ReloadDistance`: Meters of player movement before the client asks the server for benches again - `PollMinInterval` / `PollMaxInterval`: Position poll interval in ms, faster while moving, slower while standing still ## Feature Toggles **shared/config.lua** ```lua Config.Features = { Spotlight = true, PortableStations = true, Blueprints = true, QueuedCrafting = true, PropPreview = true, CraftAnimations = true, DamageInterrupt = true, MultipleCrafters = false, Invincibility = false, CommunityProjects = true, } ``` - `Spotlight`: Light above the bench while a player uses it - `PortableStations`: Player-placeable benches via inventory item - `Blueprints`: Blueprint requirement system (item or permanent unlock) - `QueuedCrafting`: Timed crafting queue, start a craft, walk away, collect later - `PropPreview`: 3D preview of the result item floating above the bench while crafting - `CraftAnimations`: Player animation during the craft - `DamageInterrupt`: Taking damage interrupts the craft in progress - `MultipleCrafters`: Allow several players on the same bench at once. When `false`, a bench lock keeps it to one user at a time - `Invincibility`: Player cannot be damaged while crafting. Only applies when `MultipleCrafters = false` - `CommunityProjects`: Server-wide shared goals players contribute materials to ## Community Projects Shared goals the whole server contributes to. Players donate materials at a station, or advance a goal by crafting the item it asks for. At 100% the project pays rewards and can unlock recipes, categories or entire station types for everyone. Projects are created and edited from the admin panel, no restart needed. **shared/config.lua** ```lua Config.CommunityProjects = { MaxPerDonation = 1000, AnnounceAt = { 25, 50, 75 }, InstantReward = true, RewardTiers = true, Leaderboard = true, ShowInAttract = true, XpPerUnit = 1, PlayerNameFormat = 'fivem', BoardRange = 25.0, BoardTint = '', } ``` - `MaxPerDonation`: Highest amount a player can donate in a single action - `AnnounceAt`: Progress percentages that trigger a server-wide announcement - `InstantReward`: Pay the per-donation reward straight away instead of only at completion - `RewardTiers`: Tiered completion rewards: top contributors, everyone above a share, or anyone who took part - `Leaderboard`: Master switch for the contributor board. Each project can also hide its own contributors from the admin panel - `ShowInAttract`: Show the running project on the station screen while nobody is using it - `XpPerUnit`: XP granted per donated unit - `PlayerNameFormat`: Name shown on the contributor board. `fivem` uses the account name, `rp_first` the character first name, `rp_full` first and last name, falling back to the first name when the character has no last name - `BoardRange`: Distance in metres at which a community board screen turns on. Every other station uses `Config.DUI.Range` - `BoardTint`: Accent colour for community boards. Leave empty to use the same accent as every other station; a per-station tint set in the admin panel overrides it > **INFO:** > > A community board is not a separate prop. Open a placed station in the admin panel under Workstations and switch its type to Community board: that station then opens the project list instead of the crafting interface, and ignores fuel, wear and the queue even if its station type uses them. ## Internal Progression Used only when `Config.ExternalSkills.Enabled = false`. Levels and XP are stored per player in the database. **shared/config.lua** ```lua Config.Progression = { Enabled = false, GlobalXp = { Base = 100, Scaling = 1.4, MaxLevel = 50, }, CategoryXp = { Base = 50, Scaling = 1.3, MaxLevel = 30, }, Points = { PerLevelUp = 1, PerCategoryLevelUp = 1, }, } ``` - `GlobalXp`: XP needed per level follows `Base * (Scaling ^ (level - 1))`. `Scaling = 1.0` is linear, above `1.0` grows exponentially, capped at `MaxLevel` - `CategoryXp`: Same formula per recipe category, each category levels separately - `Points`: Points granted on level up ## External Skills (ml_skills) **shared/config.lua** ```lua Config.ExternalSkills = { Enabled = true, Resource = 'ml_skills', Mapping = { Category = '', XpMultiplier = 1.0, PerCategory = {}, }, } ``` - `Enabled`: Delegate levels, skill checks and XP to ml_skills. Set `false` to use the internal progression above - `Resource`: Name of the external skills resource - `Mapping.Category`: Fixed ml_skills category for all crafting XP. Leave empty to auto-route by recipe category or by the recipe's required skill (recommended) - `Mapping.XpMultiplier`: Multiplier applied to recipe XP before it is sent to ml_skills - `Mapping.PerCategory`: Explicit map of ml_crafting category id to ml_skills category UID, for when the names differ ## Recipe Display & Limits **shared/config.lua** ```lua Config.Recipes = { HideUnavailable = true, HideMissingBlueprint = true, ShowLockedPreview = false, MaxQueueSize = 3, MaxBatchSize = 0, } ``` - `HideUnavailable`: Hide recipes the player cannot craft yet - `HideMissingBlueprint`: Hide recipes whose blueprint the player does not own - `ShowLockedPreview`: Show locked recipes as a preview without allowing the craft - `MaxQueueSize`: Maximum queued crafts per player across all benches. `0` = unlimited. Bench types can set their own queue limit in the admin panel - `MaxBatchSize`: Maximum quantity per single craft operation. `0` = unlimited ## Crafting Queue **shared/config.lua** ```lua Config.Queue = { CleanupEnabled = true, CleanupAfterDays = 7, CleanupCheckInterval = 3600, SharedView = true, AllowSteal = true, } ``` - `CleanupEnabled` / `CleanupAfterDays`: Uncollected ready crafts are removed after this many days - `CleanupCheckInterval`: Cleanup check interval in seconds - `SharedView`: Everyone at the bench sees everyone else's queue entries - `AllowSteal`: Players can collect other players' finished crafts. Every theft is logged through `Bridge.Log` ## Blueprints **shared/config.lua** ```lua Config.Blueprints = { GenericItemName = 'ml_blueprint', DynamicPrefix = 'blueprint_', StrictMode = false, ConsumeOnCraft = false, Durability = { Enabled = false, DefaultUses = 5, }, } ``` - `GenericItemName`: One shared inventory item that carries `metadata.blueprint = ''`. Works with metadata-capable inventories - `DynamicPrefix`: Alternative pattern, one dedicated item per blueprint, named `blueprint_