# Installations

## Step 1 ➡ Dependencies&#x20;

This is one of the most important parts, since without the dependencies, the resource will never work or not start, here we will list the dependencies with their respective links for you to download and add them to your server.

{% embed url="<https://github.com/overextended/oxmysql>" %}

## Step 2 ➡ Resources in server.cfg

{% hint style="warning" %}
if you are using ESX ➡ NEVER, but NEVER, you must place the resources above `es_extended`, if you do this they will never work and will throw errors
{% endhint %}

The correct order of the resources is as follows, always keeping <mark style="color:orange;">es\_extended</mark> and its cores above, but the other normal resources below

```
ensure sfbanking
```

{% hint style="danger" %}
if you are using **QBCore** framework remove the **qb-atms**, **qb-banking** and **qb-crypto** resource.
{% endhint %}

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE IF NOT EXISTS `sfbanking` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `bank_number` int(11) NOT NULL DEFAULT 0,
  `bank_amount` int(32) NOT NULL DEFAULT 0,
  `crypto_number` int(11) NOT NULL DEFAULT 0,
  `crypto_amount` text NOT NULL DEFAULT ('[]'),
  `business` varchar(16) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `sfbanking_logs` (
  `id` int(11) NOT NULL,
  `number` int(11) DEFAULT NULL,
  `tonumber` int(11) NOT NULL,
  `amount` int(11) DEFAULT NULL,
  `reason` varchar(256) DEFAULT NULL,
  `type` int(11) NOT NULL DEFAULT 0,
  `date` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `sfbanking_cryptologs` (
  `id` int(11) NOT NULL,
  `number` int(11) DEFAULT NULL,
  `tonumber` int(11) NOT NULL,
  `amount` float DEFAULT NULL,
  `currency` varchar(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT 0,
  `date` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `sfbanking_access` (
  `id` int(11) NOT NULL,
  `playerid` varchar(64) NOT NULL,
  `bank_number` int(16) DEFAULT NULL,
  `crypto_number` int(16) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

ALTER TABLE `sfbanking` ADD PRIMARY KEY (`id`);
ALTER TABLE `sfbanking` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `sfbanking_logs` ADD PRIMARY KEY (`id`);
ALTER TABLE `sfbanking_logs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `sfbanking_cryptologs` ADD PRIMARY KEY (`id`);
ALTER TABLE `sfbanking_cryptologs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `sfbanking_access` ADD PRIMARY KEY (`id`);
ALTER TABLE `sfbanking_access` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

```

{% endcode %}

## Step 4 ➡ Click on [Config](https://docs.scriptsfivem.com/resources/sfbanking/config)&#x20;
