This is one of the most important parts, since without the dependencies, the resource will never work or not start, here we will list the dependencies with their respective links for you to download and add them to your server.
A vin column should be added to the table with vehicles. For example, in ESX, in the owned_vehicles table, add the vin column varchar(32) not null.
ALTERTABLE`owned_vehicles`ADD`vin`varchar(32) NOT NULLAFTER`plate`;
Step 4 โก folder install-need-data
Copy the data to the appropriate scripts or database, everything is described there.
Step 5 โก folder install-need-data
Add the VIN number generation code to the script where the vehicle can be purchased so that the VIN number is generated (in the script, e.g.: esx_vehicleshop)
functionGenerateVIN()local foundNumber =falselocal vin =nilwhilenot foundNumber do vin =makeid(16) local result = exports.oxmysql:executeSync('SELECT COUNT(*) AS `count` FROM `owned_vehicles` WHERE `vin`=@info',{['@info'] = vin})
local count =tonumber(result[1].count)if count ==0then foundNumber =trueendendreturn vinendlocal charset ="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"math.randomseed(os.time())functionmakeid(length)local ret = {}local rfor i =1, length do r =math.random(1, #charset)table.insert(ret, charset:sub(r, r))endreturntable.concat(ret)end