# FAQ

## How to do localization <a href="#how-to-do-localization" id="how-to-do-localization"></a>

{% hint style="success" %}
A detailed description is available. [editing-localization-files](https://docs.0resmon.org/0resmon/0resmon-1/0r-resources/0r-forklift-operator/editing-localization-files "mention")
{% endhint %}

***

## How can I integrate my fuel? <a href="#how-can-i-integrate-my-inventory" id="how-can-i-integrate-my-inventory"></a>

{% hint style="success" %}
Check `modules/fuel/your_fuel_name/client.lua` and follow the inventory documentation
{% endhint %}

```lua
local Config = require 'config.main'

local resourceName = "your_fuel_name"
local configValue = Config.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end

Fuel = Fuel or {}

---@diagnostic disable-next-line: duplicate-set-field
Fuel.GetFuel = function(vehicle)
    if not DoesEntityExist(vehicle) then return 0.0 end
    return exports['your_fuel_name']:GetFuel(vehicle)
end

---@diagnostic disable-next-line: duplicate-set-field
Fuel.SetFuel = function(vehicle, fuel, type)
    if not DoesEntityExist(vehicle) then return end
    return exports['your_fuel_name']:SetFuel(vehicle, fuel)
end
```

***

## How can i integrate my vehiclekeys script ? <a href="#how-can-i-integrate-my-target-script" id="how-can-i-integrate-my-target-script"></a>

{% hint style="success" %}
Check `modules/vehiclekeys/your_vehiclekeys_name/client.lua` and follow the vehicle keys documentation
{% endhint %}

```lua
local Config = require 'config.main'

local resourceName = "your_vehiclekeys_name"
local configValue = Config.VehicleKey
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end

VehicleKey = VehicleKey or {}

---@diagnostic disable-next-line: duplicate-set-field
VehicleKey.GiveKeys = function(vehicle, plate)
    if not vehicle and not DoesEntityExist(vehicle) then return false end
    return exports["your_vehiclekeys_name"]:AddKey(vehicle)
end

---@diagnostic disable-next-line: duplicate-set-field
VehicleKey.RemoveKeys = function(vehicle, plate)
    if not vehicle and not DoesEntityExist(vehicle) then return false end
    return exports["your_vehiclekeys_name"]:RemoveKey(vehicle)
end
```

***

## How can i integrate my target script ? <a href="#how-can-i-integrate-my-target-script" id="how-can-i-integrate-my-target-script"></a>

{% hint style="success" %}
Check `modules/target/your_target_name/client.lua` and follow other folder and your target documentation
{% endhint %}

***

## How can i integrate my notify script ? <a href="#how-can-i-integrate-my-target-script" id="how-can-i-integrate-my-target-script"></a>

{% hint style="success" %}
Check `modules/notify/your_target_name/client.lua` and follow other folder and your notify documentation
{% endhint %}

***

## How can i integrate my progress bar script ? <a href="#how-can-i-integrate-my-target-script" id="how-can-i-integrate-my-target-script"></a>

{% hint style="success" %}
Check `modules/progressbar/your_target_name/client.lua` and follow other folder and your progressbar documentation
{% endhint %}

***

## Where are the config files?

{% hint style="success" %}
All config files are inside `config/` folder
{% endhint %}

***

## How do I change the truck model?

{% code title="0r-trucker/config/main.lua" lineNumbers="true" %}

```lua
VehicleCoords = {
    ['hauler'] = {
        [1] = vec4(-448.6, -2796.38, 5.24, 225.18),
        [2] = vec4(-457.78, -2805.56, 5.23, 225.45),
        [3] = vec4(-475.91, -2823.19, 5.23, 224.7),
        [4] = vec4(-485.06, -2832.22, 5.23, 225.48),
        [5] = vec4(-493.84, -2841.41, 5.23, 224.62),
        [6] = vec4(-502.75, -2850.27, 5.24, 225.0),
        [7] = vec4(-511.56, -2859.58, 5.23, 224.63),
    },
    ['packer'] = {
        [1] = vec4(-384.62, -2728.85, 5.11, 230.87),
        [2] = vec4(-393.62, -2734.29, 5.1, 227.97),
        [3] = vec4(-400.08, -2741.56, 5.09, 228.63),
        [4] = vec4(-401.76, -2753.03, 5.08, 227.2)
    },
    ['forklift'] = {
        [1] = vec4(-441.49, -2811.78, 4.46, 226.04),
        [2] = vec4(-439.25, -2809.51, 4.45, 225.33),
        [3] = vec4(-436.76, -2806.98, 4.45, 224.95),
        [4] = vec4(-434.18, -2804.38, 4.45, 224.72),
        [5] = vec4(-431.51, -2801.71, 4.45, 224.57),
        [6] = vec4(-428.92, -2799.07, 4.45, 224.71),
        [7] = vec4(-426.45, -2796.65, 4.45, 225.46),
        [8] = vec4(-431.86, -2821.06, 4.45, 45.06),
        [9] = vec4(-429.77, -2819.07, 4.45, 44.43),
        [10] = vec4(-427.32, -2816.66, 4.45, 45.11)
    },
    ['handler'] = {
        [1] = vec4(-511.89, -2777.72, 5.2, 314.9),
        [2] = vec4(-515.61, -2759.04, 5.2, 314.21),
        [3] = vec4(-498.11, -2750.74, 5.2, 313.45),
        [4] = vec4(-496.52, -2769.55, 5.21, 310.61),
        [5] = vec4(-483.77, -2757.51, 5.2, 314.62),
        [6] = vec4(-437.52, -2675.92, 5.2, 135.51),
        [7] = vec4(-425.5, -2687.99, 5.2, 133.95),
        [8] = vec4(-438.64, -2701.98, 5.21, 136.06)
    },
    ['your_truck_model_name'] = {
        -- Spawn coords
    }
},
```

{% endcode %}

{% code title="0r-trucker/client/cl\_task.lua:452" lineNumbers="true" %}

```lua
    local coords = 
        CheckFreeParkingSlot(
            taskType == 'container' and
            Config.VehicleCoords['your_truck_model_name'] or -- this vehicle for container job
            Config.VehicleCoords['your_truck_model_name']  -- this vehicle for cargo and vehicle transport job
        )
    if not coords then
        Debug('error', 'No free parking slots available.')
        return
    end

    Debug('info', 'Spawning task vehicle for: ' .. taskType)
    local truck = SpawnVehicle(
        taskType == 'container' and
        `your_truck_model_name` or -- this vehicle for container job
        `your_truck_model_name` --[[@as number]], -- this vehicle for cargo and vehicle transport job
        coords,
        true,
        true
    )
    if not truck then return end
```

{% endcode %}
