# Configuration

***

## <mark style="color:blue;">Fuel System Configuration Guide</mark>

This guide provides detailed instructions for configuring the `STG` fuel system script for FiveM. The script allows players to refuel their vehicles at gas stations with various fuel types. Configuration options include selecting the framework, enabling a fuel consumption system, and customizing notifications.

### <mark style="color:green;">1. Main Configuration</mark>

#### STG.Framework

* **Description:** This setting determines which framework the script will utilize to function correctly. The options are `"esx"` for ESX framework, `"qb"` for QBCore framework, or `"auto"`, which automatically detects and uses the framework that is currently active on the server. Using `"auto"` is convenient if your server might switch between frameworks or if you're unsure which one is being used.

  Example:

  ```lua
  STG.Framework = "auto" -- esx, qb, or auto
  ```

#### STG.useLegacyfuel

* **Description:** This option controls whether the script should use a legacy fuel consumption system or the newer integrated system provided by the script. Setting this to `true` will revert to the older, perhaps more familiar fuel system, which might be useful if you have other scripts relying on it. Keeping it `false` will ensure that the script uses its own optimized fuel management system.

  Example:

  ```lua
  STG.useLegacyfuel = false -- if you don't want to use our fuel consumption system, set this to true
  ```

#### STG.Debugger

* **Description:** This setting enables a debugging mode that provides additional output in the console, which can be very helpful during the development and testing phases. With `STG.Debugger` set to `true`, the script will log various activities and potential issues to help identify and fix problems. If you're setting up the script for the first time or making significant changes, it's recommended to keep this enabled. Once everything is working smoothly, you can set it to `false` to reduce console clutter.

  Example:

  ```lua
  STG.Debugger = true -- Enable detailed logging for troubleshooting purposes
  ```

### <mark style="color:green;">2. Fuel Pricing and Settings</mark>

#### STG.Settings

* **fuelPrices:** This section allows you to configure the prices for different types of fuel available at gas stations. The pricing can be adjusted based on the server's economy or to reflect real-world fuel prices, enhancing the roleplay experience. Each fuel type has a specific price per liter, and you can set them according to how valuable each type of fuel should be.

  Example:

  ```lua
  STG.Settings = {
    fuelPrices = {
      dieselPrice = 1.5,   -- Price per liter for Diesel
      superPrice = 1.7,    -- Price per liter for Super gasoline
      superplusPrice = 1.9, -- Price per liter for Super Plus gasoline
      electroPrice = 0.5,  -- Price per kWh for electric vehicles
    },
    ...
  }
  ```

#### STG.Settings.currency

* **Description:** This defines the currency symbol that will be displayed in the fuel purchase menu. It can be set to any symbol or abbreviation, such as `$`, `€`, `£`, etc., depending on your server's locale or the in-game economy you wish to simulate.

  Example:

  ```lua
  currency = "$"  -- Currency symbol used in the fuel menu
  ```

#### STG.Settings.unit & STG.Settings.unit2

* **Description:** These settings allow you to specify the unit of measurement for the fuel. `unit` is used for regular display (e.g., in notifications), while `unit2` can be used for emphasis or in specific areas of the UI where uppercase might be preferred. Commonly, this would be `"Liter"` or `"LITERS"`, but you can customize it based on the measurement system your server uses (e.g., `"Gallon"` for US servers).

  Example:

  ```lua
  unit = "Liter",     -- Measurement unit for fuel
  unit2 = "LITERS",   -- Alternative display for measurement unit
  ```

### <mark style="color:green;">3. Locale Settings</mark>

#### STG.Settings.locales

* **Description:** This section defines various text elements that will be displayed to the player in different parts of the fuel system UI. These can be customized to match the language or tone you want for your server. For instance, you can change the prompt that appears when players approach a fuel pump or the labels within the fuel menu.

  Example:

  ```lua
    locales = {
      open = "Press ~INPUT_CONTEXT~ to open fuel menu",
      title = "<b>GAS</b> STATION",
      description = "Description about update are here in few good cute words for our players should",
      totalPrice = "TOTAL <b>PRICE FOR GASOLINE</b>",
      select = "SELECT <a>FUEL TYPE</a>",
      howMuch =  "How much gasoline do you need?",
      gasolineLevel = "Gasoline Level on Car",
      gasolineSuggestion = 'Only "PLACEHOLDER" FUEL RECOMMENDED',
      cashPay = "Pay by Cash",
      cardPay = "Pay by Card",
      selectedButton = "Selected",
      notSelectedButton = "Select this"
    }
  ```

***


---

# 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://stg-store.gitbook.io/documentation/scripts/fuel/configuration.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.
