Installation

3 min readUpdated 2 weeks ago

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
1ensure oxmysql
2ensure ox_lib
3ensure ml_bridge
4ensure ml_camps
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
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
1['camp_key'] = {
2    label = 'Camp Key',
3    weight = 100,
4    stack = false,
5    close = true,
6    description = 'A key looted from a camp defender. Opens the stash of the camp it came from.',
7},

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
1    __  ____________________  __  _______  ___  ____
2   /  |/  /  _/ ___/  _/ __ \/  |/  / __ \/ _ \/ __/
3  / /|_/ // // /___/ // /_/ / /|_/ / /_/ / // /\ \
4 /_/  /_/___/\___/___/\____/_/  /_/\____/____/___/
5            ML Camps - Raidable NPC Camps System
6
7--------------------------------------------------
8[ml_camps] Resource started
9[ml_camps] Developed by Micio Mods | miciomods.it
10--------------------------------------------------
11[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.

  • /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