FearlessStudios

FS-EntityCleaner

Standalone NPC ped and vehicle cleanup for FiveM

version

Delete nearby NPC peds and vehicles with commands, a confirmation targeting mode, or optional target integrations. Framework independent, with player protection and optional ACE permissions.

Documentation Status

Earlier documentation baseline: September 7, 2026. Resource version: 1.0.0.

Start Here

  1. Follow Installation and start the required dependencies first.
  2. Review the settings below in config.lua in the installed resource.
  3. Follow the first-use steps and check the result before enabling optional integrations.

Expected result: A permitted cleanup command targets and removes a non-player entity.

Installation

The cleaner runs without a framework, database or UI library. Decide who may delete entities before enabling optional target integrations.

Use the built release folder, including its packaged UI and Lua files. See installation and full configuration for resource order and detailed setup.

Configuration

These are the current local source defaults. Change only the values needed for your setup, and restart the resource after editing its installed config.

SettingDefaultMeaning and when to change it
Config.Ace.enabledfalseWith false, the configured ACE is not required. Enable it to restrict cleanup to staff.
Config.Ace.permission"fs.entitycleaner"The ACE checked when restrictions are enabled. Change only if your permission naming requires it.
Config.ControlTimeout1500Milliseconds allowed to obtain network control. Investigate entity ownership before increasing it.

Restrict cleanup to staff, then grant the configured ACE to the intended staff group in server.cfg. This example changes existing settings; do not replace the entire file with it.

Config.Ace.enabled = true

Usage

  1. Run /entitydelete to enter confirmation targeting rather than using an immediate-delete command.
  2. Select an unwanted NPC ped or unoccupied vehicle and inspect the highlighted target.
  3. Follow the confirmation controls in the prompt. Read the notification before selecting another entity.

Use /delped or /dp for nearby NPC peds and /delveh or /dv for vehicles only when you intend immediate cleanup. Player peds are protected. The vehicle you are driving is a documented exception to occupied-vehicle protection for /dv and /delveh; check passengers before using it.

Troubleshooting

The command does not delete anything

Check distance, target type, occupied-vehicle protection and the result notification. Network control can fail even when the entity is visible.

A target-menu option is missing

Configure one supported target adapter and start its resource first; use the standalone commands to separate integration problems from cleanup problems.

Detailed guides and references

Commands

CommandAliasAction
/delped/dpDelete the closest eligible NPC ped within 5 metres by default.
/delveh/dvDelete your driven vehicle; otherwise the closest eligible vehicle within 5 metres by default.
/entitydelete/entdelToggle confirmation targeting within 10 metres by default.
/entitydelete single/entdel singleExplicit single-delete mode, the same as omitting the argument.
/entitydelete multi/entdel multiKeep confirmation targeting active after each deletion.

Normal deletion commands act immediately. All six commands include descriptions in compatible chat resources, including the configured ranges. Suggestions register when the cleaner starts and are removed when it stops. Start chat before the cleaner; after restarting chat, restart FS-EntityCleaner to restore suggestions.

When you run /dv or /delveh from the driver seat, your current vehicle takes priority regardless of the search radius. Other players aboard do not block this driver-initiated deletion. Only the vehicle is deleted; player peds are never deleted. The driver seat is rechecked while obtaining network control. As a passenger, the command uses the normal nearest-eligible-vehicle behavior. Confirmation targeting and target-menu options keep their occupied-vehicle protection.

Confirmation targeting

Run /entitydelete or /entdel to select the closest eligible NPC ped or vehicle. Selection uses distance from your player ped, not the camera or a raycast. Move between entities and the selection updates automatically, every 100 milliseconds by default.

A visible line connects you to the selection, with an optional marker above it. The bottom-center panel shows the entity type, live distance, and keyboard controls:

KeyAction
ENTERDelete the displayed selection; stay in targeting when multi-delete is on.
ESC or BACKSPACEExit targeting.

Without an argument, or with single, ENTER deletes the selection and exits targeting. Use /entitydelete multi or /entdel multi to enable multi-delete; each ENTER press deletes one entity and selects the next closest eligible entity without requiring the command again. The panel displays the selected mode. Selection and confirmation pause during deletion. The M key is not used. Invalid arguments show the command usage. Cancelling while multi-delete waits for network control aborts that pending deletion; completed deletions cannot be undone.

With no eligible entity nearby, the panel displays the search range and targeting stays active so you can move closer. Running either targeting command again cancels the mode. Player death also cancels it. Running a normal deletion command exits targeting and performs that command.

Entity protection

  • Player peds are always excluded. This cannot be disabled.
  • Vehicles containing a player in any seat are protected by default. For /dv and /delveh, the vehicle you are driving is exempt, including when other players are aboard.
  • Empty player-owned vehicles are eligible: the resource does not consult ownership databases.
  • NPC corpses and damaged vehicles are eligible.
  • Only entities streamed to the selecting client can be found.

Networked entities require network control before deletion. The resource retries within the configured timeout and checks validity, distance, and player protection again after waiting. Failed control requests or deletions show an error; there is no forced server-side deletion fallback. Local entities do not require network control.

Permissions

ACE permissions are disabled by default. Enable them in the configuration to restrict commands and target-menu deletions.