[Release] [FIXED] /car command 2.0: admin-only config and banned car list

I made this only because the /car command everyone seems to use is deprecated as hell (doesn’t use RegisterCommand, still checks for the slash and all!). And this one has more features.

Usage: /car modelname

Features:

  • Admin-only setting (configurable in server.lua- simple true/false change.)
  • Banned car list (in client.lua- uses numbers of vehicle classes) (admins can still spawn banned cars)
  • Teleports you into the car
  • Deletes the last vehicle (if you spawned it with the command)
  • Instantly turns on the engine
  • Much more feedback than the original: Lets you know what it’s doing so you don’t have to do any guesswork.

By default, military and train vehicles are banned. Simply get rid of the “19,21” on line 15 to unban them.
As for the vehicle ban list, the list uses the number ID’s for the classes to ban them. A full list of the ID’s is available in this native.

Enjoy!

No, this does not actively check if a user is in a banned car, it only prevents the spawning of them using it. This means players with access to client-side menus and other utilities can still spawn banned cars. If there is a high demand, I might make a resource to do this and actively check if a user is in a banned vehicle and kick them out if so.

carcommand2.0.zip (1.8 KB)

6 Likes

Hi, I just caught and fixed a bug right now that made the “your car has been spawned” message appear before it loaded the model. Please redownload.
EDIT: Also adds more time for models to spawn for add-on cars. Add-on cars had been taking a while.

Some photos or a short video would be nice, to show how it works etc.

Agree with PLOKMJNB

? it’s just a command. /car modelname
that’s all there is to it. i don’t have a gui or anything

its Easy /car modelname

i have spawned a car how do i delete it now?

Works Well Thanks

anyone know why when I try to spawn a custom car into the server it doesn’t let me own it?

fx_version 'cerulean'
game 'gta5'

author 'Setro'
description 'Aloows you to spawn car via command'
version '2.0.0'

client_script "client.lua"
server_script "server.lua"

please update your __resource.lua to the above. and name the file fxmanifest.lua