Integrations
Configure target menus, notifications, and custom adapters for FS-EntityCleaner
Target menus
Edit Config.Target.system in config.lua (or src/config.lua when building from source):
| Value | Behavior |
|---|---|
'auto' (default) | Prefer running ox_target, then qb-target. Commands remain available if neither is running. |
'ox_target' | Use only ox_target when it is running. |
'qb-target' | Use only qb-target when it is running. |
'custom' | Use your configured custom adapter. |
'none' | Disable target-menu integration. |
Config.Target.system = 'auto'
Config.Target.distance = 5.0Eligible NPCs show Delete Ped and eligible vehicles show Delete Vehicle. Selecting an option deletes that exact entity after server-side ACE authorization, with the same player protection, distance, and network-control checks used by commands. Target-menu actions do not require a second ENTER confirmation.
One provider is selected when FS-EntityCleaner starts: auto prefers running ox_target, then qb-target. Start your chosen provider before the cleaner. After restarting the target resource, restart FS-EntityCleaner to register its options again. Cleaner shutdown removes its registrations while the provider is available.
The separate /entitydelete mode always uses proximity selection without camera raycasting, regardless of the target integration setting.
Built-in integrations use ox_target global options and qb-target global options.
Custom target adapter
Set Config.Target.system = 'custom', set Config.Target.custom.resource to your provider's resource name, and implement both register(options) and unregister(options) in the config. These functions run only on the client. Auto mode does not discover custom providers.
The options array contains one ped entry and one vehicle entry:
| Field | Meaning |
|---|---|
kind | 'ped' or 'vehicle'; use the matching global entity registration API. |
name | Unique option name, such as FS-EntityCleaner:delete:ped. |
label | Delete Ped or Delete Vehicle. |
icon | Font Awesome icon class. |
distance | Configured interaction range. |
canInteract(entity) | Call this to filter entity eligibility, range, and busy state. |
onSelect(entity) | Call this with the selected local entity handle to request authorized deletion. |
Map these fields to your provider's API. If its selection callback returns a table, extract the entity handle first; do not pass a network ID or call DeleteEntity directly. The supplied callback preserves the cleaner's authorization and safety checks.
The register hook must finish synchronously without yielding. The unregister hook receives the same options and must remove only the registrations created by the adapter, using the identifiers your target resource expects. Make cleanup safe after a partially failed registration. Cleanup is called when the cleaner stops or registration fails while the provider is running. Restart FS-EntityCleaner after restarting the provider to register its options again.
The default custom registration hook reports that it needs configuring. A provider-specific adapter is required before 'custom' can display target options.
Notifications
Config.Notifications.system | Behavior |
|---|---|
'auto' (default) | Try lation_ui, then ox_lib, then the native GTA feed. |
'native' | Always use the native GTA feed. |
'ox_lib' | Use ox_lib; fall back directly to native if unavailable or an export throws. |
'lation_ui' | Use lation_ui; fall back directly to native if unavailable or an export throws. |
'custom' | Call your notification adapter, with native fallback. |
Prop
Type
For example, select lation_ui without replacing the rest of the config:
Config.Notifications.system = 'lation_ui'
Config.Notifications.title = 'EntityCleaner'
Config.Notifications.duration = 5000
Config.Notifications.position = 'top-right'All success/error messages, including permission denials, use this selector. The targeting mode's persistent instructions remain a standalone native-drawn panel. Built-in library positions include top, top-left, top-right, bottom, bottom-left, bottom-right, center-left, and center-right.
Providers are checked for each message, so they may start or stop without restarting the cleaner. Auto mode tries the next provider if an export fails. The adapters use client exports and do not require mandatory manifest imports: ox_lib notifications and lation_ui notifications.
Custom notifications
Select 'custom' and implement Config.Notifications.custom.notify(data). Optionally set custom.resource to the provider name to check that it is running before calling the hook. Leave it nil when the hook has no resource dependency.
The client-only hook receives:
| Field | Meaning |
|---|---|
title | Configured notification heading. |
message | Plain notification text. |
type | 'success' or 'error'. |
duration | Duration in milliseconds. |
position | Configured position. |
Translate these fields to the provider's export or event. Return false if the message cannot be displayed; native fallback will show it. Any other return value, including nil, means the message was handled. A thrown error also triggers native fallback. The default hook returns false until configured.
Verification
- Check both deletion options with an NPC, an empty vehicle, and a player-occupied vehicle.
- Test allowed and denied ACE requests with both built-in target providers.
- In auto mode, restart the cleaner with different target providers running to check ox_target priority, then qb-target fallback.
- Verify custom target callbacks receive local entity handles and cleanup removes the adapter's options.
- Trigger both a successful deletion and an error for each notification provider. Stop the provider to check native fallback.
- With both notification libraries running, auto should display one lation_ui notification per message. Test custom hooks returning
falseor throwing to check fallback.