ESX Advanced Garage - HumanTree92/VENT_ESX_Scripts GitHub Wiki
- Saying you don’t own any Vehicles / Can’t Pull Vehicles out of Garage/Impound
- If this pops up then you installed it wrong or you have edited the script. I don’t offer support if you edit anything besides the
config.lua
- If this pops up then you installed it wrong or you have edited the script. I don’t offer support if you edit anything besides the
Setting up to Work with ESX Property
Go to server/main.lua
of esx_property
& do the following:
- Under -
TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true, rented)
- Add -
xPlayer.triggerEvent('esx_advancedgarage:getPropertiesC')
- Add -
- Under -
xPlayer.triggerEvent('esx_property:setPropertyOwned', name, false)
- Add -
xPlayer.triggerEvent('esx_advancedgarage:getPropertiesC')
- Add -
Adding Categories
- Note - Make sure that the
customcategory
is set similar to how you set it up inesx_advancedvehicleshop
client/main.lua
& do the following:
Step 1: Go to - Under
elseif pJob == 'civ' and vType == 'cars' then
- Add -
ESX.TriggerServerCallback('esx_advancedgarage:getOwnedVehicles', function(ownedVehicles)
if #ownedVehicles > 0 then
table.insert(elements, {label = _U('customcategory'), value = 'customcategory', spawnloc = this_Garage.Spawner, spawnhead = this_Garage.Heading})
end
end, pJob, 'customcategory')
- Change -
customcategory
to whatever the Category is.- Example -
chevys
- Example -
locales/en.lua
& do the following:
Step 2: Go to - Under
['vans'] = 'Vans',
- Add -
['customcategory'] = 'custom category',
- Change -
customcategory
to whatever the Category is.- Example -
['chevys'] = 'Chevys',
- Example -
- Add -
server/main.lua
& do the following:
Step 3: Go to - Under -
elseif type == 'vans' then
local ownedVans = {}
MySQL.query('SELECT * FROM owned_vehicles WHERE owner = ? AND Type = ? AND job = ? AND category = ?', {xPlayer.identifier, 'car', 'civ', 'vans'}, function(data)
for _,v in pairs(data) do
local vehicle = json.decode(v.vehicle)
table.insert(ownedVans, {vehicle = vehicle, plate = v.plate, vehName = v.name, fuel = v.fuel, stored = v.stored})
end
cb(ownedVans)
end)
- Add -
elseif type == 'customcategory' then
local ownedCustomCategory = {}
MySQL.query('SELECT * FROM owned_vehicles WHERE owner = ? AND Type = ? AND job = ? AND category = ?', {xPlayer.identifier, 'car', 'civ', 'customcategory'}, function(data)
for _,v in pairs(data) do
local vehicle = json.decode(v.vehicle)
table.insert(ownedCustomCategory, {vehicle = vehicle, plate = v.plate, vehName = v.name, fuel = v.fuel, stored = v.stored})
end
cb(ownedCustomCategory)
end)
- Change -
customcategory
to whatever the Category is.- Example -
chevys
- Example -
- Change -
ownedCustomCategory
to whatever the Category is.- Example -
OwnedChevys
- Example -