Skip to main content

Generic script

If you have to hotwire a vehicle right after purchasing it, add this simple line of code to your script, after the vehicle has been added to the owned_vehicles / player_vehicles table (depending on the framework). You may want to add a Citizen.Wait(2000) before that line, in case the vehicle wasn’t yet in the table at the moment you triggered the event.

esx_vehicleshop

First step

Go to esx_vehicleshop/server/main.lua and search for the following code:
esx_vehicleshop setVehicleOwnedPlayerId before
And add this line:
esx_vehicleshop setVehicleOwnedPlayerId after

Second step

Go to esx_vehicleshop/server/main.lua (the same file as before) and search for the following code:
esx_vehicleshop buyVehicle before
And add this line:
esx_vehicleshop buyVehicle after

esx_advancedvehicleshop

Go to esx_advancedvehicleshop/server/main.lua and search for the following code:
esx_advancedvehicleshop before
And add this line:
esx_advancedvehicleshop after

qb-vehicleshop

First step

Go to qb-vehicleshop/server.lua and add the following code after all exports.oxmysql:insert calls.
In the example it’s shown only once, but you have to add it multiple times.
qb-vehicleshop before
Add the following code:
In certain parts, you’ll have to replace pData with something else. Here it shows where to add the code and what pData depends on.
qb-vehicleshop after
The green circles shown in the screenshot must match — so if the first one is, for example, targetPlayer, the second one must be targetPlayer as well.

Second step

Go to qb-vehicleshop/server.lua (the same file as before) and replace all these events (they’re at the bottom of the file):
with the following code:

okokVehicleShop

Go to okokVehicleShop/sv_utils.lua and search for the following code:
okokVehicleShop before
And add this line:
okokVehicleShop after

s4-vehicleshop

Go to s4-vehicleshop/server.lua and search for the following code:
s4-vehicleshop before
And add the following code:
s4-vehicleshop after
This code works for both oxmysql and ghmattimysql versions.

t1ger_dealerships

First step

Go to t1ger_dealerships/server/main.lua and add the following line below all occurrences (more than one) of the code shown in the example:
t1ger_dealerships before
Add the following line:
t1ger_dealerships after

Second step

Go to t1ger_dealerships/server/main.lua (the same file as before) and search for the following code:
t1ger_dealerships2 before
Add the following line:
t1ger_dealerships2 after