This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
ESX Advanced Garage
William Plunkett Jr edited this page Jul 17, 2022
·
8 revisions
- 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
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 -
- Note - Make sure that the
customcategory
is set similar to how you set it up inesx_advancedvehicleshop
- 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 -
- Under
['vans'] = 'Vans',
- Add -
['customcategory'] = 'custom category',
- Change -
customcategory
to whatever the Category is.- Example -
['chevys'] = 'Chevys',
- Example -
- Add -
- 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 -