> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-metal-detectors-docs/troubleshooting-and-faqs.md).

# Troubleshooting & FAQs

### Common Errors

#### "Start oxmysql before jiffy-metaldetectors"

oxmysql is not running when the resource starts. In `server.cfg`, make sure `ensure oxmysql` appears on a line above `ensure jiffy-metaldetectors`.

#### Admin UI won't open / "You do not have permission"

Work through this checklist:

* Confirm `add_ace group.admin jiffy-metaldetectors allow` is in your `server.cfg`
* Confirm `Config.Permissions.ace = 'jiffy-metaldetectors'` in `config.lua`
* Check whether your admin group is named something other than `group.admin` (e.g. `group.superadmin`) and update the ace line to match
* Run `refreshments` then `restart jiffy-metaldetectors` and try again

#### Detector not appearing after placement

* Run `restart jiffy-metaldetectors` in the txAdmin console
* Run `/mdlist` in-game to confirm the detector was saved to the database
* Verify `Config.UseDatabase = true` and that oxmysql is connected
* Check the server console for any SQL errors on save

#### Prop model fails to load

Only open-world accessible props can be used. Interior-only props cannot be spawned outside their MLO and will fail silently.

To verify a model before adding it: search the prop name on `forge.plebmasters.de` and check the **Created in world count** field. If the count is 1 and it belongs to an interior, the model is not usable. The default model `ch_prop_ch_metal_detector_01a` is confirmed open-world compatible.

#### Dispatch not firing

* Check `Config.Dispatch` — if set to `'none'`, dispatch is disabled globally
* Confirm your dispatch resource name matches one of the supported names: `ps-dispatch`, `cd_dispatch`, `qs-dispatch`, `core_dispatch`
* If your resource uses a different name or API, use `Hooks.Dispatch` in `editable/server_hooks.lua`
* Soft/permit alerts do not send dispatch by design — only full alarms do

#### Progress bar doesn't appear during sabotage or repair

* Confirm ox\_lib or qb-progressbar is running and started before jiffy-metaldetectors
* Check `Config.Progress` — set it explicitly if auto-detect fails, e.g. `Config.Progress = 'ox_lib'`
* To use a non-supported resource, implement `Hooks.ProgressBar` in `editable/client_hooks.lua`

#### Notification not showing

* Check `Config.Notify` in `config.lua` and set it explicitly if auto-detect is wrong
* Alternatively, implement `Hooks.Notify` in `editable/client_hooks.lua` to use any notify resource

***

### FAQ

#### Can I have detectors that don't use the database?

> Yes. Add them to `Config.Detectors` in `config.lua`. These are static and load on every start regardless of database status. A preconfigured MRPD example is included to use as a template.

#### Can I add custom prop models?

> Yes, via `Config.PropModels` in `config.lua`. The prop must be accessible in the open world — interior-only models will not work. See the prop model error section above for how to verify a model.

#### Can I use a custom inventory that isn't auto-detected?

> Yes. Implement `Hooks.ScanInventory` in `editable/server_hooks.lua`. Return a table of `{ name, category }` for each detected item and the script handles everything else.

#### Can I disable sabotage on specific detectors?

> Yes. In the Creator UI, open the detector and set **Sabotage → canDisable** to off for that detector only. The global `Config.Sabotage.enabled` setting controls the system as a whole.

#### Do players with a weapon license still trigger alarms?

> Configurable. Set `Config.Permits.behavior` to:
>
> * `'soft_alert'` — alert is sent to jobs only, player is not notified
> * `'ignore'` — no alarm fires at all
> * `'normal_alert'` — full alarm regardless of permit

#### How do I reload detectors after editing config.lua?

> Run `/mdreload` in-game, or restart the resource from txAdmin. Config-static detectors reload on restart; SQL detectors reload on both.

#### Does this work without a target resource?

> Yes. Set `Config.Target.enabled = false` to disable target interactions entirely. The detector will still alarm — players just won't have a target menu on the prop. Alternatively, leave it on `auto` and the script will skip target setup gracefully if no supported resource is found.
