Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

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

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')
  • Under - xPlayer.triggerEvent('esx_property:setPropertyOwned', name, false)
    • Add - xPlayer.triggerEvent('esx_advancedgarage:getPropertiesC')

Adding Categories

  • Note - Make sure that the customcategory is set similar to how you set it up in esx_advancedvehicleshop

Step 1: Go to client/main.lua & do the following:

  • 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

Step 2: Go to locales/en.lua & do the following:

  • Under ['vans'] = 'Vans',
    • Add - ['customcategory'] = 'custom category',
    • Change - customcategory to whatever the Category is.
      • Example - ['chevys'] = 'Chevys',

Step 3: Go to server/main.lua & do the following:

  • 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
  • Change - ownedCustomCategory to whatever the Category is.
    • Example - OwnedChevys