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.
pre-configured for ox_inventory in client_editable.lua/server_editable.lua
Step 2 โก Resources in server.cfg
if you are using ESX โก NEVER, but NEVER, you must place the resources above es_extended, if you do this they will never work and will throw errors
The correct order of the resources is as follows, always keeping es_extended, sfjob and its cores above, but the other normal resources below
Step 3 โก Database
Run query/SQL query and paste below code
Example data:
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.
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)
ALTER TABLE `owned_vehicles` ADD `vin` varchar(32) NOT NULL AFTER `plate`;
function GenerateVIN()
local foundNumber = false
local vin = nil
while not 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 == 0 then
foundNumber = true
end
end
return vin
end
local charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
math.randomseed(os.time())
function makeid(length)
local ret = {}
local r
for i = 1, length do
r = math.random(1, #charset)
table.insert(ret, charset:sub(r, r))
end
return table.concat(ret)
end