[RELEASE] /delallveh, deletes all unoccupied vehicles on the map

short story, basically the server I dev for wanted a way to clear all vehicles in the server because

  1. all /dv scripts on the forums are broken with 1s with no apparent reason.
  2. the FiveM player base doesn’t know how to delete their f*****g cars when they’re done with an rp.

I created a command that gets all vehicles in the server using IllidanS4’s entity iterator. and goes through a check to see if a person is in the driver’s seat, then several more checks to see if the vehicle was actually deleted, and then finally a nice little fraction at the end to tell you how many vehicles were actually deleted. Download can be found on my GH https://github.com/Whit3XLightning/wld-delallveh please read the config.lua for more help on setup. If you have any other questions you can ask.

P. S. to the forum admin that’s going to lock my post because I copied Delete This pls s you can clearly see that my work was commited to GitHub days ago and our code is not even close.

13 Likes

Good release! Do you happen to have a video of the process? If not its fine just wondering as im on my phone.

2 Likes

How could you make it so it deletes only in a radius of 20 or so? Nice release!

1 Like

@Jeremiah0604 There you go bud

2 Likes

To make this delete vehicles in a certain radius this whole script would most likely have to be remade. Sorry.

I can help you with that, is very easy :upside_down_face: you can do it in multiple ways.

I got an idea and you can do that in a few minutes, so:

— server
if you pass a number arg. after the default command: trigger the event only for your client (source).

— client
if the event has that number (something like AddEventHandler("wld:delallveh", function (range) check if the distance between player_ped and vehicle is <= range

1 Like

I see it has the ability to use ace perms. I was wondering if it would be possible for it to recognize the groups set in vmenu? We have group.moderator and group.admin for our staff in vmenu’s permissions and it would be nice if we could set this script to just allow group.admin to be able to run it vs everyone on our server and not have to update this scripts perms anytime we add or remove an admin. Ideally, we could just add/remove them from vmenu which we have to do anyways to allow them access to things like noclip, spectate, and teleport to player, so having this script as well recognize that would be fantastic.

1 Like

You don’t have to do any modifcations to the script for it to work like that. You just have to know how to use ace permissions. add_ace group.admin command.[commandName] allow as stated in the config.lua

I’m trying to adapt this to delete all non player peds on the map. Not having much luck lol

Are you trying to delete them with a command or not have them spawn at all?

How do I add ace permissions? whats the command that I should be giving perms to and where?

This has helped a lot of servers with modders. Great release been waiting so long! Would be amazing if there was a command like this just for props

add_ace group.admin command.delallveh allow

where should I put the add_ace group.admin command.delallveh allow

in your server.cfg, or really any .cfg file that is executed by the server.

I need help, when I run the command, it only deletes cars nearby to me. How can I make it delete all vehicles globally?

Is there a way to make certain vehicles safe from this? Like Trains and Train cars so they don’t get deleted?

i got this error after installing this script any help would be greatfull i also have a shops error too not sure wich script is causing it.

whats the cammand code

is there a video stating how to install it because im to dum to know