# Config

{% tabs %}
{% tab title="config.lua" %}

````lua
Config = {}

----------------------
-- UTILITY
----------------------
Config.Core = "qb-core" -- Your Core Name
Config.Display = "target" -- "target" or "3dtext"
Config.Target = "qb" -- "qb" or "ox"
Config.Inventory = "qb" -- "qb" or "ox"
Config.HelpText = "qb" -- "qb" or "ox"
Config.Notify = "qb" -- "standalone" or "qb" or "okok" or "ox"
Config.VehicleKeys = "qb" -- "qb" or "qs" or "renewed" or "jaksam" or "wasabi" ( open code on config_functions.lua )
Config.GiveKeys = true -- Give keys to the player when start mission ( if you dont have any coding for people steal or get the keys )
Config.Payment = "cash" -- "cash" or "bank" or "black_money" or "item" ( open code on s_utils.lua )

Config.LevelSystem = {
	vehicles = 0, -- 0 Experience need for starting a vehicle heist
	boats = 100, -- 100 Experience need for starting a boat heist
	planes = 200, -- 200 Experience need for starting a plane heist
}

Config.CallCops = {
	enable = false, -- Enable or Disable the call to the cops
	chance = 70, -- Chance of calling the cops
	dispatch = "ps-dispatch", -- "ps-dispatch" or "cd_dispatch" or "qs-dispatch"
}

Config.StartMission = {
	location = vector3(1275.78, -1710.48, 54.77), -- Location to start the mission
	blip = {enable = true, sprite = 480, color = 5, scale = 0.8, label = "Vehicle Heist"}, -- Blip settings
	minigame = false, -- Enable or Disable the minigame ( https://github.com/Project-Sloth/ps-ui )
}

Config.FinishMission = {
	vehicle = {
        vector3(-3054.41, 605.84, 7.23), --803
        vector3(259.08, -1795.08, 27.11), -- southside post 130
        vector3(-166.08, -30.23, 52.54), -- postal 556 hawick ave
        vector3(955.19, -201.15, 73.17), -- 409 mirror park blvd
        vector3(689.57, 602.61, 128.91), -- 596 theater
        vector3(-2355.24, 267.99, 165.64), -- kortz center 819 -- Location to deliver the vehicle
    },
	boat = {
		vector3(97.43, -2457.74, 0.44), -- Location to deliver the boat
	},
	airplane = {
		vector3(1705.33, 3253.09, 41.01), -- Location to deliver the plane
	},
}

Config.PossibleSpawns = {
	Vehicles = {
		[1] = { 
			coords = vector4(558.65, -1797.84, 29.2, 349.07), -- Vehicle spawn location
			vehicle = "adder", -- Vehicle model
			prize = math.random(2500,7500), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[2] = { 
			coords = vector4(476.82, -1776.67, 28.67, 267.31), -- Vehicle spawn location
			vehicle = "t20", -- Vehicle model
			prize = math.random(4255,8962), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[3] = { 
			coords = vector4(434.21, -1840.51, 27.99, 224.9), -- Vehicle spawn location
			vehicle = "sanchez", -- Vehicle model
			prize = math.random(750,1700), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[4] = { 
			coords = vector4(356.13, -1896.14, 24.8, 241.98), -- Vehicle spawn location
			vehicle = "kuruma", -- Vehicle model
			prize = math.random(3250,4750), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[5] = { 
			coords = vector4(311.6, -1939.67, 24.64, 230.46), -- Vehicle spawn location
			vehicle = "blista", -- Vehicle model
			prize = math.random(3250,4750), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
	},
	Boats = {
		[1] = { 
			coords = vector4(-305.5, -2524.96, -0.36, 47.96), -- Vehicle spawn location
			vehicle = "seashark", -- Vehicle model
			prize = math.random(2500,7500), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[2] = { 
			coords = vector4(-461.84, -2229.93, -0.47, 155.75), -- Vehicle spawn location
			vehicle = "speeder", -- Vehicle model
			prize = math.random(2500,7500), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[3] = { 
			coords = vector4(-802.75, -1505.47, -0.47, 107.4), -- Vehicle spawn location
			vehicle = "tropic2", -- Vehicle model
			prize = math.random(2500,7500), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
	},
	Planes = {
		[1] = { 
			coords = vector4(-1073.04, -2951.24, 13.95, 146.35), -- Vehicle spawn location
			vehicle = "mammatus", -- Vehicle model
			prize = math.random(2500,7500), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[2] = { 
			coords = vector4(-978.69, -3001.75, 13.95, 59.34), -- Vehicle spawn location
			vehicle = "dodo", -- Vehicle model
			prize = math.random(2500,7500), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
		[3] = { 
			coords = vector4(-1651.82, -3143.68, 13.99, 329.65), -- Vehicle spawn location
			vehicle = "velum", -- Vehicle model
			prize = math.random(2500,7500), -- Random prize
			experience = math.random(1,2), -- Random experience earned
		},
	},
}```lua
````

{% endtab %}

{% tab title="functions.lua" %}

```lua
function SendHelpText(msg, position)
    if Config.HelpText == "qb" then
        exports['qb-core']:DrawText(msg, position)
    elseif Config.HelpText == "ox" then
        lib.showTextUI(msg)
    end
end

function RemoveHelpText()
    if Config.HelpText == "qb" then
        exports['qb-core']:HideText()
    elseif Config.HelpText == "ox" then
        lib.hideTextUI()
    end
end

function Notify(msg, type, time)
    if Config.Notify == "standalone" then
        BeginTextCommandThefeedPost("STRING")
        AddTextComponentSubstringPlayerName(msg)
        EndTextCommandThefeedPostTicker(true, true)
    elseif Config.Notify == "qb" then
        QBCore.Functions.Notify(msg, type, time)
    elseif Config.Notify == "okok" then
        exports['okokNotify']:Alert('Notification', msg, 5000, type, true)
    elseif Config.Notify == "ox" then
        lib.notify({ title = 'Notification', description = msg, type = type })
    end
end

function GiveKeys(vehicle)
    local plate = GetVehicleNumberPlateText(vehicle)
    local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
    if Config.VehicleKeys == "qb" then
        TriggerEvent("vehiclekeys:client:SetOwner", plate)
    elseif Config.VehicleKeys == "qs" then
        exports['qs-vehiclekeys']:GiveKeys(plate, model)
    elseif Config.VehicleKeys == "renewed" then
        exports['Renewed-Vehiclekeys']:addKey(plate)
    elseif Config.VehicleKeys == "jaksam" then
        TriggerServerEvent("vehicles_keys:selfGiveVehicleKeys", plate)
    elseif Config.VehicleKeys == "wasabi" then
        exports.wasabi_carlock:GiveKey(plate)
    end
end

function CallCops(spawnLocation, vehicleModel)
    if Config.CallCops.dispatch == 'cd_dispatch' then
        local data = exports['cd_dispatch']:GetPlayerInfo()
        TriggerServerEvent('cd_dispatch:AddNotification', {
            job_table = {'police'},
            coords = spawnLocation,
            title = '10-10 - Car Thief',
            message = 'A '..data.sex..' possibly committing a crime '..data.street,
            flash = 0,
            unique_id = tostring(math.random(0000000,9999999)),
            blip = {
                sprite = 156,
                scale = 1.2,
                colour = 1,
                flashes = false,
                text = '911 - Illegal Fishing',
                time = (5*60*1000),
                sound = 1,
            }
        })
    elseif Config.CallCops.dispatch == 'ps-dispatch' then
        exports["ps-dispatch"]:CustomAlert({
            coords = spawnLocation,
            message = "911 - Car Thief",
            dispatchCode = "10-10 Car Thief",
            description = "possibly committing a crime",
            gender = true,
            radius = 0,
            sprite = 156,
            color = 1,
            scale = 1.2,
            length = 3,
        })
    elseif Config.CallCops.dispatch == 'qs-dispatch' then
        TriggerServerEvent('qs-dispatch:server:CreateDiapatchCall', {
             job = 'police',
             callLocation = spawnLocation,
             callCode = {code = '911 - Car Thief', snippet = '10-10 Car Thief'},
             message = 'possibly committing a crime',
             flashes = 'Boolean',
             image = 'URL.png',
             blip = {
                sprite = 110,
                scale = 1.5,
                colour = 1,
                flashes = true,
                text = '10-10 Car Thief',
                time = (6*60*1000),-- 6 minutes
            }
        })
    end
end
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mscripts.gitbook.io/docs/qbcore/illegal/qb-car-thief/config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
