Skip to main content

QS Dispatch

ESX

At the bottom of the file replace the functions with these

qs-dispatch/server/custom/framework/esx.lua
function GetPlayerLicenses(identifier)
local licences = MySQL.query.await('SELECT license FROM licenses WHERE owner = @identifier;',
{ ['@identifier'] = identifier })
if licences ~= nil then
local licenses = {}
for _, license in ipairs(licences) do
table.insert(licenses, license.license)
end
-- DebugPrint('///----///----///----///----///----///----///----///----')
-- DebugPrint(licenses)
-- DebugPrint('///----///----///----///----///----///----///----///----')
return licenses
end
end

function AddLicence(identifier, type, oldType, cb)
-- if the old type exist we need to update it and if not we need to insert it if oldType is not nil check it on SQL
local xPlayer = ESX.GetPlayerFromIdentifier(identifier)
if xPlayer then
TriggerClientEvent('LicenseManager:addLicense', xPlayer.source, type, 'police')
end
end

function DeleteLicence(identifier, type, cb)
TriggerServerEvent('LicenseManager:revokeLicense', identifier, type)
end