Installation

3 min readUpdated 2 weeks ago

Overview

ML Camps adds raidable NPC camps. A camp stays empty until a player walks in, then spawns its defenders, tracks the fight, pays out loot on the clear and respawns after a cooldown. Camps are built in an in-game admin panel with a map view, a live overview and an editor for every NPC group.

Quick Start

  1. Download from CFX Portal
  2. Extract to your resources folder as ml_camps
  3. 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. Optional resources such as ML Inventory and ml_battlepass start before it.

Database

Tables are created on first start. The first three are also in _INSTALL/ml_camps.sql if you prefer to import them by hand.

  • ml_camps: camp definitions written by the admin panel
  • ml_camp_state: camp status and respawn time, so cooldowns and depleted camps survive restarts
  • ml_camps_settings: HUD and loot key settings saved from the panel
  • ml_camps_bp_runs, ml_camps_bp_outbox, ml_camps_bp_cache, ml_camps_bp_sources, ml_camps_bp_guard: battlepass progress queue. They are only filled when ml_battlepass runs

Item Registration

No item is needed by default. The loot key runs in 'virtual' mode and is tracked by the server. Register the key item from _INSTALL/items.lua only if you switch Config.LootKey.Mode, or the panel setting, to 'item':

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 items are your own. Every item name in a camp loot table must exist in your inventory.

Verify

The console prints the version banner and:

cfg
1[ml_camps] [INFO] ml_camps server ready

Run /campsadmin as an admin to open the panel. Walking into a camp spawns its NPCs and shows the raid HUD.

  • /campsadmin does nothing: the player lacks the Creator permission. Grant an ACE from Config.Permissions.Creator, for example add_ace group.admin ml_camps.creator allow.
  • No camps on the map: the server starts with no camps. Create one from the panel.
  • No blips: check Config.Settings.BlipsEnabled and the blip toggle of the camp.
  • NPCs do not spawn: the ped model is wrong or not streamed. The console warns Model "x" not in CDImage, and a camp that spawns no NPC goes back to idle.
  • Loot items never drop: the item names in the loot table must exist in your inventory.
  • No key in item mode: register camp_key. The console prints an error that points to _INSTALL/items.lua. Or switch the key mode back to 'virtual'.
  • A camp stays cleared: a spawn-once camp stays depleted until you press Force Reset in the Live tab.