vms_driveschool
Replace the event in config.server.lua
config/config.server.lua
RegisterNetEvent('vms_driveschoolv2:sv:addLicense', function(passed, type)
local src = source
if passed then
if Config.Core == "ESX" then
TriggerClientEvent('LicenseManager:addLicense', src, type)
local foundLicenses = false
repeat
exports.bcs_licensemanager:GetLicenses(src, function(licenses)
if licenses and next(licenses) then
for i = 1, #licenses, 1 do
local license = licenses[i].type
if type == license then
foundLicenses = true
TriggerClientEvent('vms_driveschoolv2:cl:getLicenses', src, licenses)
break
end
end
end
end)
Wait(500)
until foundLicenses
elseif Config.Core == "QB-Core" then
TriggerClientEvent('LicenseManager:addLicense', src, type)
local foundLicenses = false
repeat
exports.bcs_licensemanager:GetLicenses(src, function(licenses)
if licenses and next(licenses) then
for i = 1, #licenses, 1 do
local license = licenses[i].type
if type == license then
foundLicenses = true
TriggerClientEvent('vms_driveschoolv2:cl:getLicenses', src, licenses)
break
end
end
end
end)
Wait(500)
until foundLicenses
end
end
end)
Config.Licenses = {
Theory = {
['A'] = {name = 'dmv1', price = 150, enabled = true},
['B'] = {name = 'dmv2', price = 300, enabled = true},
['C'] = {name = 'dmv3', price = 450, enabled = true}
},
Practical = {
['A'] = {name = 'driver_truck', price = 2500, enabled = true},
['B'] = {name = 'driver_car', price = 4500, enabled = true},
['C'] = {name = 'driver_bike', price = 6500, enabled = true}
}
}