Firstly you will need to add the following to each dealership in the config.lua
licenseCheck =false, -- false = no license required to open dealershiplicense ='driver', -- this is the license name required
You will need to replace the following function in config-sv.lua "jg-dealerships:server:showroom-pre-check"
Framework.Server.CreateCallback("jg-dealerships:server:showroom-pre-check", function(src,cb,dealershipId)local allowed =false-- ESX LICENSE CHECKSlocal licenseCheck = Config.DealershipLocations[dealershipId].licenseCheck local license = MySQL.scalar.await('SELECT type FROM user_licenses WHERE type = ? AND owner = ?', {Config.DealershipLocations[dealershipId].license, Framework.Server.GetPlayerIdentifier(src)})
if licenseCheck thenifnot license then allowed =falseelseif license then allowed =trueendelse allowed =trueendifnot allowed then Framework.Server.Notify(src, "You are not allowed to access the showroom", "error")returncb({ error =true })endreturncb()end)
If you only want to setup individual dealerships and not all you can replace config-sv function with the following config-sv.lua
Framework.Server.CreateCallback("jg-dealerships:server:showroom-pre-check", function(src,cb,dealershipId)local allowed =true-- ESX License Check-- dealershipId is the name of your dealership in the config.luaif dealershipId =="boat" then local license = MySQL.scalar.await('SELECT type FROM user_licenses WHERE type = ? AND owner = ?', {Config.DealershipLocations[dealershipId].license, Framework.Server.GetPlayerIdentifier(src)})
ifnot license then allowed =falseendendifnot allowed then Framework.Server.Notify(src, "You are not allowed to access the showroom (server-side)", "error")returncb({ error =true })endreturncb()end)