> For the complete documentation index, see [llms.txt](https://forever-developments.gitbook.io/forever-developments/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://forever-developments.gitbook.io/forever-developments/assets/vehicle-as-item/configuration.md).

# Configuration

<details>

<summary>View Config</summary>

```
Shared = {}

Shared.vehicleItems = {
   ["security_card_01"] = "kuruma",  -- Item name for vehicle 1
   ["stone"] = "jester",  -- Item name for vehicle 2
   -- Add new item names and vehicle names here
}


--█▀▀ █▀█ ▄▀█ █▀▄▀█ █▀▀ █░█░█ █▀█ █▀█ █▄▀
--█▀░ █▀▄ █▀█ █░▀░█ ██▄ ▀▄▀▄▀ █▄█ █▀▄ █░█


Shared.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ]   If you select 'auto_detect', only ESX and QBCore frameworks will be detected. Use 'other' for custom frameworks.

Shared.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ]   If you select 'auto_detect', only ESX, QBCore, okokNotify, ps-ui and ox_lib notifications will be detected. Use 'other' for custom notification resources.

Shared.SpawnVehicle = false  -- Set this to false if you don't want to spawn the vehicle when using the item.

Shared.removeitem = true  -- Set this to false if you don't want to remove the item from the inventory after it is used.



--█▀▄ █▀█   █▄░█ █▀█ ▀█▀   ▀█▀ █▀█ █░█ █▀▀ █░█   ▀█▀ █░█ █ █▀
--█▄▀ █▄█   █░▀█ █▄█ ░█░   ░█░ █▄█ █▄█ █▄▄ █▀█   ░█░ █▀█ █ ▄█


Shared.FrameworkTriggers = {
    esx = { --If you have modified the default event names in the es_extended resource, change them here.
        resource_name = 'es_extended',
        main = 'esx:getSharedObject',
        load = 'esx:playerLoaded',
        job = 'esx:setJob'
    },
    qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
        resource_name = 'qb-core',
        main = 'QBCore:GetObject',
        load = 'QBCore:Client:OnPlayerLoaded',
        job = 'QBCore:Client:OnJobUpdate',
        gang = 'QBCore:Client:OnGangUpdate',
        duty = 'QBCore:Client:SetDuty'
    }
}


if Shared.Framework == 'auto_detect' then
    if GetResourceState('es_extended') == 'started' then
        Shared.Framework = 'esx'
    elseif GetResourceState('qb-core') == 'started' then
        Shared.Framework = 'qbcore'
    end
    if Shared.Framework == 'esx' or Shared.Framework == 'qbcore' then
        for c, d in pairs(Shared.FrameworkTriggers[Shared.Framework]) do
            Shared.FrameworkTriggers[c] = d
        end
        Shared.FrameworkTriggers.esx, Shared.FrameworkTriggers.qbcore = nil, nil
    end
end

if Shared.Notification == 'auto_detect' then
    if GetResourceState('okokNotify') == 'started' then
        Shared.Notification = 'okokNotify'
    elseif GetResourceState('ps-ui') == 'started' then
        Shared.Notification = 'ps-ui'
    elseif GetResourceState('ox_lib') == 'started' then
        Shared.Notification = 'ox_lib'
    else
        Shared.Notification = Shared.Framework
        if Shared.Notification == 'standalone' or Shared.Notification == 'vrp' then Config.Notification = 'chat' end
    end
end











```

</details>

<details>

<summary>Notification</summary>

```
--███╗   ██╗ ██████╗ ████████╗██╗███████╗██╗ ██████╗ █████╗ ████████╗██╗ ██████╗ ███╗   ██╗███████╗
--████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██║██╔════╝██╔══██╗╚══██╔══╝██║██╔═══██╗████╗  ██║██╔════╝
--██╔██╗ ██║██║   ██║   ██║   ██║█████╗  ██║██║     ███████║   ██║   ██║██║   ██║██╔██╗ ██║███████╗
--██║╚██╗██║██║   ██║   ██║   ██║██╔══╝  ██║██║     ██╔══██║   ██║   ██║██║   ██║██║╚██╗██║╚════██║
--██║ ╚████║╚██████╔╝   ██║   ██║██║     ██║╚██████╗██║  ██║   ██║   ██║╚██████╔╝██║ ╚████║███████║
--╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝╚═╝     ╚═╝ ╚═════╝╚═╝  ╚═╝   ╚═╝   ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝

RegisterNetEvent('fw-usableitem:notify')
AddEventHandler('fw-usableitem:notify', function(notif_type ,message)
    Notification(notif_type ,message)
end)

function Notification(notif_type, message)
    if notif_type and message then
        if Shared.Notification == 'esx' then
            ESX.ShowNotification(message)
        
        elseif Shared.Notification == 'qbcore' then
            if notif_type == 1 then
                QBCore.Functions.Notify(message, 'success')
            elseif notif_type == 2 then
                QBCore.Functions.Notify(message, 'primary')
            elseif notif_type == 3 then
                QBCore.Functions.Notify(message, 'error')
            end
        
        elseif Shared.Notification == 'okokNotify' then
            if notif_type == 1 then
                exports['okokNotify']:Alert('Forever Script', message, 5000, 'success')
            elseif notif_type == 2 then
                exports['okokNotify']:Alert('Forever Script', message, 5000, 'info')
            elseif notif_type == 3 then
                exports['okokNotify']:Alert('Forever Script', message, 5000, 'error')
            end
        
        elseif Shared.Notification == 'ps-ui' then
            if notif_type == 1 then
                exports['ps-ui']:Notify(message, 'success', 5000)
            elseif notif_type == 2 then
                exports['ps-ui']:Notify(message, 'primary', 5000)
            elseif notif_type == 3 then
                exports['ps-ui']:Notify(message, 'error', 5000)
            end
        
        elseif Shared.Notification == 'ox_lib' then
            if notif_type == 1 then
                lib.notify({title = 'Forever Script', description = message, type = 'success'})
            elseif notif_type == 2 then
                lib.notify({title = 'Forever Script', description = message, type = 'inform'})
            elseif notif_type == 3 then
                lib.notify({title = 'Forever Script', description = message, type = 'error'})
            end

        elseif Shared.Notification == 'chat' then
            TriggerEvent('chatMessage', message)
            
        elseif Shared.Notification == 'other' then
            --add your own notification.
            
        end
    end
end
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://forever-developments.gitbook.io/forever-developments/assets/vehicle-as-item/configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
