> For the complete documentation index, see [llms.txt](https://needforscript.gitbook.io/needforscripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://needforscript.gitbook.io/needforscripts/our-scripts/billing-script/installation.md).

# Installation

### Prerequisites

Before installing the N4S Billing Script, ensure you have the following dependencies:

#### Required Dependencies

* 📦 [ox\_lib](https://github.com/overextended/ox_lib)
* 🌉 [bl\_bridge](https://github.com/Byte-Labs-Studio/bl_bridge)

### 📦 Installation Steps

#### 1. Dependencies Installation

1. Install [ox\_lib](https://github.com/overextended/ox_lib)
2. Install [bl\_bridge](https://github.com/Byte-Labs-Studio/bl_bridge)
3. Ensure your framework is up to date

#### 2. Database Setup

### SQL Tables

Execute the following SQL queries in your database:

```sql
CREATE TABLE IF NOT EXISTS `billing_invoices` (
  `id` char(17) NOT NULL,
  `billFrom` text NOT NULL,
  `billTo` text NOT NULL,
  `paid` tinyint(4) NOT NULL DEFAULT 0,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `createdAt` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;


CREATE TABLE IF NOT EXISTS `billing_presets` (
  `id` char(255) DEFAULT NULL,
  `data` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;


CREATE TABLE IF NOT EXISTS `billing_society` (
  `id` varchar(30) NOT NULL,
  `balance` bigint(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

```

### 🚨 Important Notes

* Ensure your database user has permissions to create and modify tables
* Backup your database before installation
* Run these queries in your server's database

#### 3. Script Installation

1. Download the N4S Billing Script
2. Place in your `resources` folder
3. Add to your `server.cfg` or `resources.cfg`
4. Add bl\_bridge convars to your server.cfg with your server optionsµ<br>

   ```
   # Frameworks 'ox' | 'qb' | 'esx' | 'qbx'
   setr bl:framework 'qb' 

   # Inventories 'ox' | 'qb' | 'esx' | 'ps' | 'qs' | 'origen' | 'none'
   setr bl:inventory 'ox'

   # Context 'ox' | 'qb'
   setr bl:context 'ox'

   # Target 'ox' | 'qb'
   setr bl:target 'ox'

   # Progress 'ox' | 'qb'
   setr bl:progressbar 'ox'

   # Radial 'ox' | 'qb'
   setr bl:radial 'ox'

   # Notification 'ox' | 'qb' | 'esx'
   setr bl:notify 'ox'

   # TextUI 'ox' | 'qb' | 'esx'
   setr bl:textui 'o
   ```

#### Need Help?

* Check our Discord support channel
* Review the comprehensive documentation

### ✅ Installation Checklist

* [ ] Install ox\_lib
* [ ] Install bl\_bridge
* [ ] Create SQL tables
* [ ] Place script in resources and start it on your .cfg file
* [ ] Configure settings
* [ ] Restart server
