CS_CARCLEAR

A vehicle cleanup system. Automatically despawns vehicles that are far from players at scheduled times, with optional Discord webhooks and notifications.


Installation

start cs_carclear

Configuration

Config.lua

This configuration file controls admin duty, noclip, vanish, team chat, giveskin, job handling, cooldowns, and rank-based skins.

Deletion Schedule
  • deletionTimes – Table of times (hh:mm) when vehicles will be cleared. Example: "00:00" = true, "00:30" = true, "01:00" = true ...

Admin Duty Commands
  • adutyCommand – Command to toggle admin duty. Example: 'ad'.

  • keyMappingToggleAdutyKey – Optional keybinding.

Command Settings
  • clearCommandName – Command to manually clear vehicles. Example: "despawn".

  • noRightsMsg – Message if player lacks permission. Example: "Dafür hast du keine Rechte!".

  • allowedForCommand – Groups allowed to use the clear command. Example: { "owner", "projektleitung", "teamleitung" }.

Vehicle Settings
  • DontDeleteVehicles – Table of vehicle model names to exclude from deletion. Example: { "journey" }.

  • distance – Distance in meters from any player below which vehicles will not be deleted. Example: 20.0.

Webhook Settings
  • SendWebhookEnabled – true / false – Enable Discord webhook notifications.

  • WebhookTitle – Title of the webhook message. Example: "Fahrzeuge gecleart".

  • WebhookMessage – Message content. Example: "Alle Fahrzeuge, die weiter als 20 Meter von einem Spieler entfernt waren, wurden gelöscht.".

Notifications

The system can announce upcoming or completed vehicle clears:

cf_carclear.carclearAnnounceNotification(minutes)
  • "AllCarsCleared" – Announce when vehicles were cleared.

  • minutes > 1 – Announce countdown to vehicle deletion in minutes.

  • minutes == 1 – Announce 1-minute countdown.

Notifications are integrated with cs_hud:

exports['cs_hud']:showAnnounce('Announce', "Message")

Other notification options can be uncommented (okokNotify, ws_announce).


Webhook Configuration

webhooks.lua
cf_carclear.webhookLink = 'https://discord.com/api/webhooks/...'
  • Sends a message to Discord when vehicles are cleared.

Tip: Leave the URL as an empty string "" if you do not want the webhook to trigger for that event.


Notes
  • Vehicles beyond the defined distance from players will be automatically deleted.

  • Exempt vehicles (e.g., server vehicles) will not be removed.

  • Works with old and new ESX versions.

  • Optional Discord webhooks can notify staff of vehicle clears.

  • Command permissions are role-based.


Support

If you have any further questions, open a ticket on our discord server: discord.gg/core-services

Last updated

Was this helpful?