[ESX] Anti Vehicle Theft

This script checks if someone has a job that is configured as allowed for that vehicle. If not the player either gets kicked out or the engine gets disabled. Everything is done client sided.
I saw someone make a similar resource to this one, but then paid. Since it’s a very simple check, I decided to make it and release it for free. I probably spend more time on the readme than the script itself so yeah.

With the default interval configuration the script ran at 0.00ms when idle or in a vehicle, and max around 0.02ms when disabling a vehicle for me.

Features:

  • Multiple job support
  • Either kick or disable a vehicle
  • Set interval and messages

Here is a picture of the default messages shown (bottom for kicking and top for disabling):
image

The script also triggers r3-antivehicletheft:onKick when a player gets kicked out of a vehicle or r3-antivehicletheft:onDisable when a vehicle gets disabled. You can use these events to create logs or whatever you want. You can also just edit the code directly, which would be easier.

If people want me to convert the script to QBCore ask down below, although they have their own key system so I would just stick to that.

Github: https://github.com/r3ps4J/r3-antivehicletheft
And showcase:


My other resources
If you like this resource, you might like some of my other work as well:

Prospecting with treasure map
Food Delivery like Uber Eats
Location Items
Evidence Storage
Delivery job for different jobs

2 Likes

Great release, but I can’t see the Event triggered by client.lua > line 26 and line 31.

line 26: TriggerEvent(“r3-antivehicletheft:onKick”)

line 31:TriggerEvent(“r3-antivehicletheft:onDisable”)

Is this event in other resources?

Nice release, and free! Awesome work!

No, you will have to add a listener yourself if you want to use those events.

Ok, I got it, these events are unnecessary and I was careless about that. :sweat_smile:

awsome! So i put the kick on false for disable the car but i would like add a thing like, if the guys stay in the car he can try to lock pick and stoll the car… ! and have acces to the trunk

You can edit the code, try adding a variable to the loop that prevents it from triggering the disable when the car is lockpicked. Then update that variable with whatever lockpicking script you use.

this can set for id steam player … other player cant in vehicle

What do you mean? I don’t think there is anything related to steam used in the script

I mean, can we set up using a player steam id instead of using job.

No. If you want that you will have to edit the resource yourself

hello sir… have version qbcore ?

No, but it’s not that hard to change.

i have error at clieant.lua [playerJob = playerData.job.name]

Yeah, because that part is made for ESX.

can you help me sir i send my client.lua