# Functions

```lua
local QBCore = exports[Config.Core]:GetCoreObject()

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('Vehicleshop', msg, 5000, type, true)
    elseif Config.Notify == "ox" then
        lib.notify({ title = 'Vehicleshop', description = msg, type = type })
    end
end

function GiveKeys(veh)
    local plate = GetVehicleNumberPlateText(veh)
    local model = GetDisplayNameFromVehicleModel(GetEntityModel(veh))
    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 SetFuel(veh)
    if Config.Fuel == "LegacyFuel" then
        exports["LegacyFuel"]:SetFuel(veh, 100.0)
    elseif Config.Fuel == "okokFuel" then
        exports['okokGasStation']:SetFuel(veh, 100.0)
    elseif Config.Fuel == "ox_fuel" then
        SetVehicleFuelLevel(veh, 100.0)
    elseif Config.Fuel == "ti_fuel" then
        exports["ti_fuel"]:setFuel(veh, 100.0, "RON91")
    elseif Config.Fuel == "qs-fuel" then
        exports['qs-fuelstations']:SetFuel(veh, 100.0)
    elseif Config.Fuel == "cdn-fuel" then
        SetVehicleFuelLevel(veh, 100.0)
    end
end

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 GetVehicleName(hash)
    local name = GetDisplayNameFromVehicleModel(hash)
    return name
end

function SendEmail(carName, carPrice)
    if Config.Email.phone == "qb-phone" then
        TriggerServerEvent("qb-phone:server:sendNewMail", {
            sender = "PDM Vehicleshop",
            subject = "New purchase",
            message = "Congratulations for you new purchase! Hope you enjoy the vehicle.<br>Vehicle Information:<br>Vehicle Model: "..carName.."<br>Vehicle Price: $"..carPrice,
        })
    elseif Config.Email.phone == "qs-smartphone" then
        TriggerServerEvent("qs-smartphone:server:sendNewMail", {
            sender = "PDM Vehicleshop",
            subject = "New purchase",
            message = "Congratulations for you new purchase! Hope you enjoy the vehicle.<br>Vehicle Information:<br>Vehicle Model: "..carName.."<br>Vehicle Price: $"..carPrice,
        })
    elseif Config.Email.phone == "gksphone" then
        TriggerServerEvent("gksphone:NewMail", {
            sender = "PDM Vehicleshop",
            image = '/html/static/img/icons/mail.png',
            subject = "New purchase",
            message = "Congratulations for you new purchase! Hope you enjoy the vehicle.<br>Vehicle Information:<br>Vehicle Model: "..carName.."<br>Vehicle Price: $"..carPrice,
         })
    end
end
```


---

# 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/jobs/qb-vehicleshop/config/functions.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.
