DRC Scripts

Give Vehicle Keys:

SpawnVehicle = function(model, coords, heading, livery)
    if Config.Framework == "ESX" then
        ESX.Game.SpawnVehicle(model, coords, heading, function(vehicle)
            SetEntityHeading(vehicle, heading)
            SetVehicleLivery(vehicle, livery)
            local plate = GetVehicleNumberPlateText(vehicle)
            exports['ic3d_vehiclekeys']:ClientInventoryKeys('add', plate)
        end)
    elseif Config.Framework == "qbcore" then
        QBCore.Functions.SpawnVehicle(model, function(vehicle)
            SetEntityHeading(vehicle, heading)
            SetVehicleLivery(vehicle, livery)
            local plate = QBCore.Functions.GetPlate(vehicle)
            exports['ic3d_vehiclekeys']:ClientInventoryKeys('add', plate)
        end, coords, true)
    elseif Config.Framework == "standalone" then
        -- Für Standalone ebenfalls Schlüssel hinzufügen
        local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, true, false)
        SetEntityHeading(vehicle, heading)
        SetVehicleLivery(vehicle, livery)
        local plate = GetVehicleNumberPlateText(vehicle)
        exports['ic3d_vehiclekeys']:ClientInventoryKeys('add', plate)
    end
end

Remove Vehicle Keys:

Last updated

Was this helpful?