# okokGasStation

[**YouTube Video**](https://www.youtube.com/watch?v=aZs14PhkCm0)

## **Installation Guide**

#### Execute the following SQL code in your database:

```sql
CREATE TABLE `okokgasstation_stores`(
    `store_name` varchar(255) NOT NULL,
    `store_id` varchar(255) NOT NULL PRIMARY KEY,
    `owner` varchar(255) NULL DEFAULT NULL,
    `owner_name` varchar(255) NULL DEFAULT NULL,
    `money` varchar(255) NOT NULL,
    `business_price` varchar(255) NOT NULL,
    `gas_price` DECIMAL(10, 2) NOT NULL DEFAULT 2.00,
    `current_stock` varchar(255) NOT NULL,
    `max_stock` varchar(255) NOT NULL,
    `employees` longtext NULL,
    `vehicles` longtext NULL,
    `inactivity_date` varchar(255) DEFAULT NULL
);

CREATE TABLE `okokgasstation_orders`(
    `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `store_id` varchar(255) NOT NULL,
    `liters` varchar(255) NOT NULL,
    `vehicle` varchar(255) NOT NULL,
    `long_vehicle` varchar(255) NOT NULL,
    `reward` varchar(255) NOT NULL,
    `in_progress` varchar(255) NOT NULL,
    `employee_name` varchar(255) NOT NULL,
    `employee_id` varchar(255) NOT NULL
);

CREATE TABLE `okokgasstation_saleshistory`(
    `store_id` varchar(255) NOT NULL,
    `buyer_id` varchar(255) NOT NULL,
    `buyer_name` varchar(255) NOT NULL,
    `liters` varchar(255) NOT NULL,
    `price` varchar(255) NOT NULL,
    `date` varchar(255) NOT NULL
);
```

### Exports

```lua
exports['okokGasStation']:GetFuel(vehicle)
exports['okokGasStation']:SetFuel(vehicle, fuel)
exports['okokGasStation']:AddGasStationFuel(gasStationID, fuel)
exports['okokGasStation']:RemoveGasStationFuel(gasStationID, fuel)
```

### Set the Discord Webhook URL (to enable logs)

Navigate to the `sv_utils.lua` file and paste the webhook URL in the line 2.

[How to create a Discord Webhook URL](https://ahsda89sgdh18923asd.gitbook.io/main/others/discord-webhook)

### Server artifacts

Make sure your server artifacts version is above the **5181**.

* Windows: <https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/>
* Linux: <https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/>


---

# 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://docs.okokscripts.io/scripts/okokgasstation.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.
