# Miscellaneous

### Vehicle Keys

```lua
-- function to provide keys for vehicles
function GiveKeys(veh, tempKeys)
    if tempKeys then
        -- if your script supports different logic for temporary keys
        TriggerServerEvent('vehiclekeys:client:SetOwner', QBCore.Functions.GetPlate(veh))
    else
        -- if your script supports different logic for permanent keys
        TriggerEvent('vehiclekeys:client:SetOwner', QBCore.Functions.GetPlate(veh))
    end
end
```

QB Vehiclekeys doesn't support different logic for temporary and primary keys, so you can add common events on both section, but if your script does then provide the events/exports to it respective locations

### Boss Menu

```lua
function OpenBossMenu(job)
    -- event/export to open boss menu from the script
    TriggerEvent('qb-bossmenu:client:OpenMenu')
end
```

### Add Funds to Boss Menu

Event/Exports to add funds to bossmenu that are recieved from test drive or buy vehicle

```lua
function AddFund(amount, job)
    if GetResourceState('qb-management') == 'started' then
        exports['qb-management']:AddMoney(job, amount)
    end
end
```

### Remove Item From Stash

This function is used to remove an item from stash, necessary to remove car docs when on successful trade gets removed from stash

### Fuel Script

Export to use fuel script with the vehicleshop

```lua
function SetVehicleFuel(veh, amt)
    exports['LegacyFuel']:SetFuel(veh, amt)
end
```
