Skip to main content

XN MDT

Replace

function GetESXPlayerLicenses(identifier)
local licences = {}
local promise = promise:new()
local esxLicenses = MySQL.query.await('SELECT * FROM licenses WHERE owner = ?', {
identifier
})
exports.bcs_licensemanager:GetLicensesList(function(licenseList)
for i = 1, #licenseList, 1 do
local license = licenseList[i]
for j = 1, #esxLicenses, 1 do
if esxLicenses[j].license == license.type and Config.RevokableLicenses[license.type] then
-- if esxLicenses[j].license == license.type then
table.insert(licences, {
type = license.type,
label = license.label
})
end
end
end
promise:resolve(licences)
end)

return Citizen.Await(promise)
end

function RemoveESXPlayerLicense(licenseType, identifier, cb)
MySQL.update('DELETE FROM licenses WHERE type = ? AND owner = ?', { licenseType, identifier },
function(rowsChanged)
if rowsChanged then
cb(true, licenseType)
else
cb(false)
end
end)
end