REMOVE_NPC_V3

Dit is een FiveM-script dat NPC’s en voertuigen in bepaalde zones verwijdert. Dit script kan handig zijn voor RP-servers om een schonere omgeving te creëren.

Functies

  • Verwijder NPC’s: Verwijdert NPC’s die zich binnen een bepaalde afstand van gedefinieerde zones bevinden.
  • Verwijder Voertuigen: Verwijdert specifieke voertuigen (bijvoorbeeld politie- of noodvoertuigen) binnen de gedefinieerde zones.
  • ** Verwijder Voertuigen**: Verwijder normale voortuigen ook via blacklist list
  • Debug Modus: Zet een debug-modus aan om meer informatie te krijgen tijdens het testen.

Installatie

  1. Download de repository: Kloneer deze repository of download de ZIP.
  2. Plaats het script: Zet de map in de resources-map van je FiveM-server.
  3. Configureer het script: Pas de configuratie aan in config.lua om zones en instellingen naar wens in te stellen.

Configuratie

In config.lua vind je de volgende instellingen:

  • debug: Zet dit op true om debug-informatie te zien in de console.
  • zones: Hier kun je de verschillende zones definiëren. Elke zone heeft een naam, coördinaten en een afstand.
  • npcDelete: Zet dit op true om NPC’s in die zone te verwijderen.
  • vehicleDelete: Zet dit op true om voertuigen in die zone te verwijderen. Werk alleen als je de voertuig blacklist zet
  • vehicleDelete: blacklist en whitlist voor de zone

Update Controleren

Het script controleert automatisch op updates via de GitHub API. Het doet dit elk uur en print een melding in de console en chat als er een nieuwe versie beschikbaar is.

Bijdragen

Als je wilt bijdragen aan dit project, voel je vrij om een pull request te maken of problemen te melden.

Licentie

Dit project is gelicentieerd onder de MIT-licentie. Zie het LICENSE-bestand voor meer informatie.

Made croky19

Full Changelog: Comparing REMOVE_NPC_V2...REMOVE_NPC_V3 · Croky18/REMOVE_NPC_V1 · GitHub


REMOVE_NPC_V3

This is a FiveM script that removes NPCs and vehicles in specified zones. This script can be useful for RP servers to create a cleaner environment.

Features

  • Remove NPCs: Removes NPCs that are within a certain distance from defined zones.
  • Remove Vehicles: Removes specific vehicles (e.g., police or emergency vehicles) within the defined zones.
  • Blacklist Vehicles: Also removes normal vehicles via a blacklist.
  • Debug Mode: Activate a debug mode to receive more information during testing.

Installation

  1. Download the repository: Clone this repository or download the ZIP.
  2. Place the script: Put the folder into your FiveM server’s resources directory.
  3. Configure the script: Adjust the configuration in config.lua to set up zones and settings to your liking.

Configuration

In config.lua, you will find the following settings:

  • debug: Set this to true to enable debug information in the console.
  • zones: Here you can define various zones. Each zone has a name, coordinates, and a distance.
  • npcDelete: Set this to true to remove NPCs in that zone.
  • vehicleDelete: Set this to true to remove vehicles in that zone. Works only if the vehicle blacklist is set.
  • vehicleBlacklist: Define the blacklist and whitelist for the zone.

Checking for Updates

The script automatically checks for updates via the GitHub API. It does this every hour and prints a message in the console and chat if a new version is available.

Contributing

If you would like to contribute to this project, feel free to make a pull request or report issues.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Made by croky19

Download New

https://github.com/Croky18/REMOVE_NPC_V1/releases/tag/REMOVE_NPC_V3

5 Likes

Like it :+1:

thank you if you have any problems let me know :grin: :grin: :grin:

Bad practice to call native on every tick.

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0) -- Wacht 1 seconde voordat opnieuw te controleren/---- Wait 1 second before checking again

        local playerCoords = GetEntityCoords(PlayerPedId())
        
        for _, zone in ipairs(zones) do
            local distanceToZone = #(zone.center - playerCoords)

            if distanceToZone <= zone.distance then
                DeleteEntitiesInZone(zone)
            end
        end
    end
end)
1 Like

do you have an error ??

a few updates have been made to the script file

nice! i was literally just looking for a script like this! can i still spawn in cars in that area that i use? want it for my dealerships since cars spawn in the view area lol

1 Like

thank you if you have any problems let me know :grin: :grin: :grin:

Would it not make more sense to use entityCreating on the server to block stuff like this? Just check of the population type is ambient or scenario GetEntityPopulationType - FiveM Natives @ Cfx.re Docs

2 Likes

there will be another update on the way

1 Like

so its working but i cant spawn in my player owned cars, anyway to only have it setup for ped cars?

we are changing everything so that only npc vehicles are deleted and not player vehicles

1 Like

We are busy with a new update of the script

A new update for REMOVE_NPC V2

:boom: :boom: When I go to that area with the vehicle I own, the vehicle I am driving also disappears.