# Installation

### Dependencies

* [**ic\_lib**](https://incity-development.gitbook.io/incity-development/resources/ic_lib)
* [**ox\_lib**](https://github.com/overextended/ox_lib/releases/tag/v3.30.6)
* [**oxmysql**](https://github.com/overextended/oxmysql)
* **frameworks** - qb, esx (one of them is required)
* **inventories** - qb, ox (one of them is required)
  * requires inventory with metadata support
* **targets** - qb, ox (optional, resource works without target systems)

### Installation Steps

#### 1. Install Dependencies

Ensure all dependencies are installed and working.

#### 2. Download ic\_moneywash

Place the `ic_moneywash` folder in your server's `resources` directory.

#### 3. Add to server.cfg

```cfg
# Load dependencies first
ensure oxmysql
ensure ox_lib  
ensure your_framework
ensure your_inventory
ensure your_target_system
ensure ic_lib

# Then load ic_moneywash
ensure ic_moneywash
```

#### 4. Configure Database

The script will automatically create required tables on first start:

* `trapphone_players` - Player money data and statistics
* `trapphone_transactions` - Transaction history logging

No manual database setup required.

#### 5. Add Required Items

Please, keep in mind that all items are editable in configuration, so you aren't forced to use our items we set for it!

Add these items to your inventory system (optional):

{% tabs %}
{% tab title="qb-core" %}
{% code title="qb-core/shared/items.lua" %}

```lua
-- Trap phone item
['trapphone'] = {
    ['name'] = 'trapphone',
    ['label'] = 'Trap Phone',
    ['weight'] = 200,
    ['type'] = 'item',
    ['image'] = 'trapphone.png',
    ['unique'] = false,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['description'] = 'Encrypted phone for underground operations'
},

-- Cash bag item  
['cashbag'] = {
    ['name'] = 'cashbag',
    ['label'] = 'Cash Bag',
    ['weight'] = 1000,
    ['type'] = 'item',
    ['image'] = 'cashbag.png',
    ['unique'] = true,
    ['useable'] = false,
    ['shouldClose'] = true,
    ['description'] = 'Heavy bag full of cash'
},

-- Dirty money item (if not already present)
['markedbills'] = {
    ['name'] = 'markedbills',
    ['label'] = 'Marked Bills',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'markedbills.png',
    ['unique'] = false,
    ['useable'] = false,
    ['shouldClose'] = true,
    ['description'] = 'Suspicious looking money'
}
```

{% endcode %}
{% endtab %}

{% tab title="esx" %}

```sql
INSERT INTO `items` (`name`, `label`, `weight`) VALUES
('trapphone', 'Trap Phone', 200),
('cashbag', 'Cash Bag', 1000),
('markedbills', 'Marked Bills', 100);
```

{% endtab %}

{% tab title="ox inventory" %}

<pre class="language-lua" data-title="ox_inventory/data/items.lua"><code class="lang-lua">-- Trap phone item
<strong>['trapphone'] = {
</strong>	label = 'Trap Phone',
	weight = 190,
	stack = true,
	consume = 0,
	client = {
		export = "ic_moneywash.openPhone"
	}
},

-- Cash bag item
["cashbag"] = { -- 
	label = "Bag of Cash",
	weight = 0,
	stack = false,
	close = true,
	client = {
		image = "cashbag.png",
	}
},
-- Dirty money item (if not already present)
["markedbills"] = {
	label = "Dirty Money",
	weight = 0,
	stack = true,
	close = true,
	description = "Money?",
	client = {
		image = "markedbills.png",
	}
},
</code></pre>

{% endtab %}
{% endtabs %}

#### 6. Add Item Images

Place these image files in your inventory images folder:

* `trapphone.png`
* `cashbag.png`
* `markedbills.png` (if not present)

### Verification

#### Test Installation

1. Start your server
2. Check console for any errors
3. Verify database tables were created

### Common Issues

* **Script not starting**: Check dependency load order in server.cfg
* **Database errors**: Ensure oxmysql is properly configured
* **Items not working**: Verify items are added to your framework's item system
