LC Scripts

lc_utils/framework/qbcore/client.lua:5

function Utils.Framework.giveVehicleKeys(vehicle, plate, model)
    if Config.custom_scripts_compatibility.keys == "qs-vehiclekeys" then
        exports['qs-vehiclekeys']:GiveKeys(plate, model)
    elseif Config.custom_scripts_compatibility.keys == "cd_garage" then
        TriggerEvent('cd_garage:AddKeys', exports['cd_garage']:GetPlate(vehicle))
    elseif Config.custom_scripts_compatibility.keys == "wasabi_carlock" then
        exports['wasabi_carlock']:GiveKey(plate)
    elseif Config.custom_scripts_compatibility.keys == "MrNewbVehicleKeys" then
        exports.MrNewbVehicleKeys:GiveKeys(vehicle)
    elseif Config.custom_scripts_compatibility.keys == "Renewed" then
        exports['Renewed-Vehiclekeys']:addKey(plate)
    elseif Config.custom_scripts_compatibility.keys == "tgiann-hotwire" then
        exports["tgiann-hotwire"]:SetNonRemoveableIgnition(vehicle, true)
    elseif Config.custom_scripts_compatibility.keys == "ic3d_vehiclekeys" then
        exports.ic3d_vehiclekeys:ClientInventoryKeys('add', plate)
    elseif Config.custom_scripts_compatibility.keys == "default" or Config.custom_scripts_compatibility.keys == "jaksam" then
        TriggerEvent("vehiclekeys:client:SetOwner", plate)
    else
        Utils.CustomScripts.giveVehicleKeys(vehicle, plate, model)
    end
end

function Utils.Framework.removeVehicleKeys(vehicle)
    local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
    local plate = Utils.Vehicles.getPlate(vehicle)

    if Config.custom_scripts_compatibility.keys == "qs-vehiclekeys" then
        exports['qs-vehiclekeys']:RemoveKeys(plate, model)
    elseif Config.custom_scripts_compatibility.keys == "wasabi_carlock" then
        exports['wasabi_carlock']:RemoveKey(plate)
    elseif Config.custom_scripts_compatibility.keys == "Renewed" then
        exports['Renewed-Vehiclekeys']:removeKey(plate)
    elseif Config.custom_scripts_compatibility.keys == "MrNewbVehicleKeys" then
        exports.MrNewbVehicleKeys:RemoveKeys(vehicle)
    elseif Config.custom_scripts_compatibility.keys == "ic3d_vehiclekeys" then
        exports.ic3d_vehiclekeys:ClientInventoryKeys('remove', plate)
    elseif Config.custom_scripts_compatibility.keys == "default" or Config.custom_scripts_compatibility.keys == "cd_garage" or Config.custom_scripts_compatibility.keys == "jaksam" or Config.custom_scripts_compatibility.keys == "tgiann-hotwire" then
        -- Do nothing :)
    else
        Utils.CustomScripts.removeVehicleKeys(vehicle)
    end
end

function Utils.Framework.removeVehicleKeysFromPlate(plate, model)
    if Config.custom_scripts_compatibility.keys == "qs-vehiclekeys" then
        exports['qs-vehiclekeys']:RemoveKeys(plate, model)
    elseif Config.custom_scripts_compatibility.keys == "Renewed" then
        exports['Renewed-Vehiclekeys']:removeKey(plate)
    elseif Config.custom_scripts_compatibility.keys == "wasabi_carlock" then
        exports['wasabi_carlock']:RemoveKey(plate)
    elseif Config.custom_scripts_compatibility.keys == "MrNewbVehicleKeys" then
        exports.MrNewbVehicleKeys:RemoveKeysByPlate(plate)
    elseif Config.custom_scripts_compatibility.keys == "ic3d_vehiclekeys" then
        exports.ic3d_vehiclekeys:ClientInventoryKeys('remove', plate)
    elseif Config.custom_scripts_compatibility.keys == "default" or Config.custom_scripts_compatibility.keys == "cd_garage" or Config.custom_scripts_compatibility.keys == "jaksam" or Config.custom_scripts_compatibility.keys == "tgiann-hotwire" then
        -- Do nothing :)
    else
        Utils.CustomScripts.removeVehicleKeysFromPlate(plate, model)
    end
end

Last updated

Was this helpful?