> ## Documentation Index
> Fetch the complete documentation index at: https://axeldevelopment.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation Guide

Follow these steps to install the script:

1. **Download** the script from Cfx Portal.
2. Install All Dependencies. You can check the list here: [Dependencies](/gas-station/dependencies).
3. **Extract** the `axel_gasstation` folder to your resources.
4. **Run the SQL** file found in the script folder.
5. Set the item in your inventory script.
6. Add `ensure axel_gasstation` to your `server.cfg`.
7. Restart your server and enjoy :)
8. IN CFG

```lua theme={null}

ensure ox_lib
ensure ox_target (or qb-target)
ensure oxmysql
ensure es_extended (or qb-core)
ensure ox_inventory (or qb-inventory)

ensure axel_gasstation
ensure axel_fuel    
```

### Inventory Image

<img className="w-full rounded-xl shadow-lg border border-white/10" src="https://r2.fivemanage.com/pKlTXBH8m7kKAHXFsMDpA/gas_loyalty_card.png" alt="Ox_inventory item image" style={{ width:"20%" }} />

### ITEM - ox\_inventory

```lua theme={null}
['gas_loyalty_card'] = {
    label = 'Loyality Card',
    weight = 0,
    stack = false,
    close = true,
    client = {
        image = 'gas_loyalty_card.png', 
    }
},
```

### ITEM - qb-inventory

```lua theme={null}
['gas_loyalty_card'] 			 = {['name'] = 'gas_loyalty_card', 			  	['label'] = 'Gas Loyalty Card', 		['weight'] = 0, 		['type'] = 'item', 		['image'] = 'gas_card.png', 		['unique'] = true, 		['useable'] = false, 	['shouldClose'] = false,	   ['combinable'] = nil,   ['description'] = 'Gas Discount Card'},
```

### ITEM - jaksam\_inventory

* from the menu you add the item, and look carefully if the name is in lowercase letters, if not you should change it.

### SQL FILE

```lua theme={null}
Docs: https://axeldevelopment.mintlify.app/AxelScripts

CREATE TABLE IF NOT EXISTS `gas_stations` (
    `station_id` VARCHAR(50) NOT NULL,
    `owner` VARCHAR(100) DEFAULT NULL,
    `owner_name` VARCHAR(100) DEFAULT 'State Owned',
    `custom_name` VARCHAR(100) DEFAULT NULL,
    `balance` INT(11) DEFAULT 0,
    `fuel_stock` VARCHAR(255) DEFAULT '{"diesel":0,"premium":0,"benzin":0}',
    `electricity_stock` INT(11) DEFAULT 0,
    `xp` INT(11) DEFAULT 0,
    `level` INT(11) DEFAULT 1,
    `total_earnings` INT(11) DEFAULT 0,
    `weekly_earnings` INT(11) DEFAULT 0,
    `total_customers` INT(11) DEFAULT 0,
    `last_tax_paid` INT(11) DEFAULT 0,
    `last_weekly_reset` INT(11) DEFAULT 0,
    `jerrycan_price` VARCHAR(255) DEFAULT '{"diesel": 100, "premium": 150, "benzin": 120}',
    `jerrycan_elec_price` INT(11) DEFAULT 50,
    `daily_earnings` VARCHAR(255) DEFAULT '{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0}',
    `logs` LONGTEXT DEFAULT '[]',
    `price` VARCHAR(255) DEFAULT '{"diesel": 25, "premium": 30, "benzin": 20}',
    `electricity_price` DOUBLE DEFAULT 25.0,
    `employees` LONGTEXT DEFAULT '[]',
    `electro_sessions` INT(11) DEFAULT 0,
    `electro_earnings` INT(11) DEFAULT 0,
    `has_attendant` INT(11) DEFAULT 0,
    `active_attendant` INT(11) DEFAULT 1,
    `electric_upgrade` INT(11) DEFAULT 0,
    `refinery_level` INT(11) DEFAULT 0,
    `refinery_condition` INT(11) DEFAULT 100,
    `refinery_stock` VARCHAR(255) DEFAULT '{"diesel":0,"premium":0,"benzin":0}',
    `refinery_savings` INT(11) DEFAULT 0,
    `loyalty_monthly_earnings` VARCHAR(512) DEFAULT '{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0}',
    `last_active` INT(11) DEFAULT 0,
    PRIMARY KEY (`station_id`),
    KEY `idx_owner` (`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `gas_station_cards` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `station_id` VARCHAR(50) NOT NULL,
    `holder_identifier` VARCHAR(100) NOT NULL,
    `holder_name` VARCHAR(100) NOT NULL,
    `discount` INT(11) NOT NULL DEFAULT 10,
    `issued_by` VARCHAR(100) NOT NULL,
    `issued_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
    `usage_count` INT(11) DEFAULT 0,
    `total_spent` INT(11) DEFAULT 0,
    PRIMARY KEY (`id`),
    UNIQUE KEY `unique_card` (`station_id`, `holder_identifier`),
    KEY `idx_holder` (`holder_identifier`),
    CONSTRAINT `fk_gas_station_cards` FOREIGN KEY (`station_id`) REFERENCES `gas_stations` (`station_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
```
