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):
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.
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.