# Welcome

Welcome to the official documentation of scriptsfivem.com, here you will have the installation guides and basic snippets for each resource in our store

## Visit our store!

Our store awaits you, here we have a website where you can access the store and even support, you just have to register and link your cfx.re account with us

## **Failed to verify protected resource sfResourcename**

This error means that files were corrupted during the download. Make sure to use a different FTP client, such as <https://winscp.net/eng/download.php>.

## **You lack the required entitlement to use sfResourcename**

Please try restarting your server and verify your keymaster account.

## Discord

You need help? Join our discord. Create a ticket and wait patiently for an answer.


# sfphone


# 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>" %}

{% embed url="<https://github.com/citizenfx/screenshot-basic>" %}

{% embed url="<https://github.com/Xogy/xsound>" %}
If you use another script, you can configure it in server\_editable.lua (need only for radio app)
{% endembed %}

## 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 screenshot-basic
ensure xsound
ensure sfphone
```

{% hint style="danger" %}
if you are using **QBCore** framework remove the **qb-phone** resource
{% endhint %}

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
DROP TABLE IF EXISTS `phone_advertising`;
DROP TABLE IF EXISTS `phone_callhistory`;
DROP TABLE IF EXISTS `phone_cgroups`;
DROP TABLE IF EXISTS `phone_contacts`;
DROP TABLE IF EXISTS `phone_gallery`;
DROP TABLE IF EXISTS `phone_messages`;
DROP TABLE IF EXISTS `phone_news`;
DROP TABLE IF EXISTS `phone_settings`;
DROP TABLE IF EXISTS `phone_sim`;
DROP TABLE IF EXISTS `phone_twitter_accounts`;
DROP TABLE IF EXISTS `phone_twitter_likes`;
DROP TABLE IF EXISTS `phone_twitter_tweets`;
DROP TABLE IF EXISTS `phone_twitter_tweets_deleted`;
DROP TABLE IF EXISTS `phone_love_accounts`;
DROP TABLE IF EXISTS `phone_love_likes`;
DROP TABLE IF EXISTS `phone_love_messages`;
DROP TABLE IF EXISTS `phone_darkchat_chats`;
DROP TABLE IF EXISTS `phone_darkchat_accounts`;

CREATE TABLE `phone_advertising` (
  `id` int(11) NOT NULL,
  `number` int(11) NOT NULL,
  `description` text NOT NULL,
  `url` varchar(256) DEFAULT NULL,
  `date` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_callhistory` (
  `id` int(11) NOT NULL,
  `accept` varchar(2) NOT NULL DEFAULT '0',
  `number` int(11) DEFAULT NULL,
  `fromnumber` int(11) NOT NULL,
  `tonumber` int(11) NOT NULL,
  `date` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_cgroups` (
  `id` int(11) NOT NULL,
  `idgroup` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `lider` int(11) NOT NULL DEFAULT 0,
  `idserver` int(11) NOT NULL,
  `namesurname` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_contacts` (
  `id` int(11) NOT NULL,
  `number` int(11) DEFAULT NULL,
  `name` varchar(64) DEFAULT NULL,
  `namenumber` int(11) DEFAULT NULL,
  `nameurl` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_gallery` (
  `id` int(11) NOT NULL,
  `number` int(11) NOT NULL,
  `url` varchar(256) NOT NULL,
  `date` varchar(64) NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_messages` (
  `id` int(11) NOT NULL,
  `number` int(11) NOT NULL,
  `readed` varchar(2) NOT NULL DEFAULT '0',
  `fromnumber` int(11) NOT NULL,
  `tonumber` int(11) NOT NULL,
  `message` text NOT NULL,
  `date` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_news` (
  `id` int(11) NOT NULL,
  `title` varchar(128) NOT NULL,
  `text` text NOT NULL,
  `img` text NOT NULL,
  `namesurname` varchar(128) NOT NULL,
  `data` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_settings` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `background` int(11) NOT NULL DEFAULT 1,
  `backgroundurl` varchar(255) DEFAULT NULL,
  `sound` float NOT NULL DEFAULT 0.15,
  `vibrations` int(11) NOT NULL DEFAULT 0,
  `brightness` float NOT NULL DEFAULT 1,
  `size` float NOT NULL DEFAULT 0,
  `notify_twitter` int(2) NOT NULL DEFAULT 1,
  `notify_sms` int(2) NOT NULL DEFAULT 1,
  `notify_love` int(2) NOT NULL DEFAULT 1,
  `notify_darkchat` int(2) NOT NULL DEFAULT 1,
  `notify_mechanic` int(2) NOT NULL DEFAULT 1,
  `darkmode` int(2) NOT NULL DEFAULT 0,
  `streamermode` int(2) NOT NULL DEFAULT 0,
  `blockednumbers` text NOT NULL DEFAULT('[]'),
  `notes` text DEFAULT NULL,
  `apps` text NOT NULL DEFAULT('[]'),
  `ringtone` varchar(256) DEFAULT 'phone_ringtone.mp3',
  `ringtone_notify` varchar(512) DEFAULT 'phone_notification.mp3'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_sim` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `number` int(11) NOT NULL,
  `active` int(11) NOT NULL DEFAULT 0,
  `duplicat` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_twitter_accounts` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `nowlogged` varchar(64) NOT NULL,
  `number` int(11) NOT NULL,
  `username` varchar(32) NOT NULL,
  `password` varchar(64) NOT NULL,
  `avatar` varchar(256) DEFAULT NULL,
  `likes` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_twitter_likes` (
  `id` int(11) NOT NULL,
  `id_tweet` int(11) NOT NULL,
  `username` varchar(64) NOT NULL,
  `liked` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_twitter_tweets` (
  `id` int(11) NOT NULL,
  `username` varchar(64) NOT NULL,
  `message` mediumtext NOT NULL,
  `image` varchar(256) DEFAULT NULL,
  `likes` int(11) NOT NULL DEFAULT 0,
  `date` varchar(32) NOT NULL,
  `avatar` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_twitter_tweets_deleted` (
  `id` int(11) NOT NULL,
  `username` varchar(64) NOT NULL,
  `message` mediumtext NOT NULL,
  `image` varchar(256) DEFAULT NULL,
  `likes` int(11) NOT NULL DEFAULT 0,
  `date` varchar(32) NOT NULL,
  `avatar` varchar(256) DEFAULT NULL,
  `admin` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_love_accounts` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `nowlogged` varchar(64) DEFAULT NULL,
  `number` int(11) NOT NULL,
  `username` varchar(32) NOT NULL,
  `name` varchar(64) NOT NULL,
  `password` varchar(64) NOT NULL,
  `description` varchar(512) DEFAULT NULL,
  `photos` text DEFAULT NULL,
  `settings` varchar(96) NOT NULL DEFAULT '{"age":18,"sex":"m","lookingfor":"w"}'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_love_likes` (
  `id` int(11) NOT NULL,
  `fromaccount` varchar(64) NOT NULL,
  `toaccount` varchar(64) NOT NULL,
  `fromlike` int(2) NOT NULL,
  `tolike` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_love_messages` (
  `id` int(11) NOT NULL,
  `account` varchar(64) NOT NULL,
  `readed` varchar(2) NOT NULL DEFAULT '0',
  `fromaccount` varchar(64) NOT NULL,
  `toaccount` varchar(64) NOT NULL,
  `message` text NOT NULL,
  `date` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_darkchat_accounts` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `username` varchar(32) NOT NULL,
  `chats` text NOT NULL DEFAULT('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_darkchat_chats` (
  `id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL,
  `owner` varchar(64) DEFAULT NULL,
  `players` text NOT NULL DEFAULT('[]'),
  `invitecode` varchar(64) NOT NULL,
  `messages` longtext NOT NULL DEFAULT('[]'),
  `date` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `phone_photostory_accounts` (
  `id` int(11) NOT NULL,
  `owner` varchar(46) DEFAULT NULL,
  `nowlogged` varchar(64) NOT NULL,
  `password` varchar(32) NOT NULL,
  `account` varchar(32) NOT NULL,
  `name` varchar(32) NOT NULL,
  `description` varchar(256) DEFAULT NULL,
  `avatar` text DEFAULT NULL,
  `follow` int(8) NOT NULL DEFAULT 0,
  `followers` int(8) NOT NULL DEFAULT 0,
  `likes` text NOT NULL,
  `follows` text NOT NULL,
  `notifications` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `phone_photostory_posts` (
  `idpost` int(11) NOT NULL,
  `account` varchar(32) NOT NULL,
  `description` varchar(256) NOT NULL,
  `image` varchar(512) NOT NULL,
  `comments` longtext NOT NULL,
  `likes` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `phone_advertising` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_callhistory` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_cgroups` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_contacts` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_gallery` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_messages` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_news` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_settings` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_sim` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_twitter_accounts` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_twitter_likes` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_twitter_tweets` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_twitter_tweets_deleted` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_love_accounts` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_love_likes` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_love_messages` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_darkchat_accounts` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_darkchat_chats` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_photostory_accounts` ADD PRIMARY KEY (`id`);
ALTER TABLE `phone_photostory_posts` ADD PRIMARY KEY (`idpost`);
ALTER TABLE `phone_advertising` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_callhistory` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_cgroups` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_contacts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_gallery` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_messages` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_news` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_settings` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_sim` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_twitter_accounts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_twitter_likes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_twitter_tweets` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_twitter_tweets_deleted` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_love_accounts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_love_likes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_love_messages` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_darkchat_accounts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_darkchat_chats` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_photostory_accounts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `phone_photostory_posts` MODIFY `idpost` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
```

{% endcode %}

{% hint style="danger" %}
The last step is to modify the player data table. <mark style="color:red;">Important!</mark> Use the code for your engine.
{% endhint %}

{% tabs %}
{% tab title="ESX" %}

```sql
UPDATE `users` SET `phone_number`=0;
ALTER TABLE `users` MODIFY `phone_number` INT(16) DEFAULT 0;
UPDATE `users` SET `phone_number`=0;
```

{% endtab %}

{% tab title="QB-CORE" %}

```sql
ALTER TABLE `players` ADD `phone_number` INT(16) DEFAULT 0;
```

{% endtab %}

{% tab title="Your framework" %}

```sql
ALTER TABLE `YOUR_TABLE_WITH_PLAYER_DATA` ADD `phone_number` INT(16) DEFAULT 0;
```

{% endtab %}
{% endtabs %}

## Step 4 ➡ Click on [Config](/resources/sfphone/config)&#x20;


# Config

## file config.lua

Select framework, language, voice system, notification system and inventory system.

{% hint style="danger" %}
if the <mark style="color:red;">webHookDiscordUrl</mark> is not configured correctly, the photos will not be saved and the phone will not work properly.
{% endhint %}

if your language is unavailable in the list, you can make your own translation.

{% hint style="info" %}
Set up your own banking system or buy sfbanking 😉
{% endhint %}

## file config.js

Select language and set the options that interest you.

if your language is unavailable in the list, you can make your own translation.


# Exports

## Lua code examples for Client Side

```lua
local phoneIsUseNow = exports["sfphone"]:phoneIsUseNow()
print(phoneIsUseNow) -- return true or false
```

```lua
local mycgroup = exports["sfphone"]:cgroupPlayer()
if mycgroup > 0 then
    print("Your id group is "..mycgroup)
else
    print("You havent a group")
end
```

Use if the phone stops working

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

## Lua code examples for Server Side

```lua
local src = source 
exports["sfphone"]:createCgroup(src) -- creates a group in cGroups app
```

```lua
local id_group = 5 -- for e.g
exports["sfphone"]:removeCgroup(id_group) -- remove a group in cGroups app
```

If you want to block the SIM card and make a duplicate

```lua
local src = source 
exports["sfphone"]:openMenuResetSim(src)
```

If you want to install apps on your phone with an external script

<pre class="language-lua"><code class="lang-lua">local src = source 
<strong>local applicationName = "cgroups" -- support "aparat", "gallery", "bank", "appstore",
</strong><strong>-- "news", "notes", "advertising", "twitter", "walletc", "cgroups", "racing"
</strong>local applicationPrice = 1000 -- 1000($), you can change to other number, 0 or false
<strong>exports["sfphone"]:installApp(src, applicationName, applicationPrice)
</strong></code></pre>

Example of sending SMS for players from other your scripts

```lua
local toNumberPhone = 12345 -- if the phone number is incorrect, you will receive a notify
local message = "Hello World" -- some text
local fromNumber = 1 -- example for ALERT in config.js 
local imgURL = nil -- some url for image, only formats .jpg .jpeg .png or set nil
exports["sfphone"]:sendNewMessageFromScript(toNumberPhone, message, fromNumber, imgURL)
```

As an administrator, you can create a sim card with any number you want

{% hint style="danger" %}
If you do not have permission this function will not work
{% endhint %}

<pre class="language-lua"><code class="lang-lua">local src = source 
<strong>local numberPhone = 123 -- if the phone number is unavailable, you will receive a notify
</strong>local sourceIdPlayer = 1 -- enter player ID server
exports["sfphone"]:createSimByAdmin(src, numberPhone, sourceIdPlayer)
</code></pre>

Example of sending SMS for group players from application cGroups

```lua
local fromNumber = 1 -- example for ALERT in config.js 
local idGroup = 5-- if you set 0 it will not work
local message = "Hello World" -- some text
local imgURL = "https://media.discordapp.net/attachments/947451128767987712/1010941186275545138/screenshot.jpg" -- some url for image, only formats .jpg .jpeg .png or set nil
exports["sfphone"]:sendNewMessageTocGroup(fromNumber, idGroup, message, imgURL)
```

Example of sending SMS for online players

```lua
local fromNumber = 1 -- example for ALERT in config.js 
local message = "Hello World" -- some text
local imgURL = "https://media.discordapp.net/attachments/947451128767987712/1010941186275545138/screenshot.jpg" -- some url for image, only formats .jpg .jpeg .png or set nil
exports["sfphone"]:sendNewMessageToOnline(fromNumber, message, imgURL)
```

Example of retrieving a player's current phone number

```lua
local src = source
exports["sfphone"]:getNumberFromSource(src)
```

Custom notification for player

```lua
local src = source
local time = 10 -- in seconds (notification display time)
local text = "Hello World" -- some text
exports["sfphone"]:customNotification(src, time, text)
```


# Open phone

{% hint style="warning" %}
IMPORTANT! Inventory must supports metadata. I recommend ox\_inventory.
{% endhint %}

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

## For resource ox\_inventory

Add the following code in the file `ox_inventory/data/items.lua`

<pre class="language-lua"><code class="lang-lua">
<strong>['mobilephone'] = {
</strong>	label = 'Smartphone',
	weight = 500,
	stack = false,
	close = true,
	client = {
		export = 'sfphone.mobilephone', -- if you use ox_inventory_examples 'yourscript.mobilephone'
	},
	consume = 0
},
['simcard'] = {
	label = 'Sim card',
	weight = 100,
	stack = false,
	client = {
		export = 'sfphone.simcard', -- if you use ox_inventory_examples or 'yourscript.simcard'
	},
	consume = 0
},

</code></pre>

Add the following images to the folder `ox_inventory/web/images`&#x20;

<div><figure><img src="https://3417600217-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUstiQCWWtCVFlim0J8Rh%2Fuploads%2FqvPBEis3aKAEypSSFW0e%2Fmobilephone.png?alt=media&amp;token=92821202-87b5-4d8b-b5e7-ec6279edce33" alt=""><figcaption><p>mobilephone.png</p></figcaption></figure> <figure><img src="https://3417600217-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUstiQCWWtCVFlim0J8Rh%2Fuploads%2FZIaxndr6SBwxqmgPbcMw%2Fsimcard.png?alt=media&amp;token=48cbcc39-7279-4c08-8490-21030ece29a6" alt=""><figcaption><p>simcard.png</p></figcaption></figure></div>


# sfracing


# Installations

{% hint style="warning" %}
Currently only supports with sfphone!
{% endhint %}

## 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>" %}

{% embed url="<https://github.com/mkafrin/PolyZone>" %}

## 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 screenshot-basic
ensure sfracing
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
DROP TABLE IF EXISTS `sfracing_tracks`;

CREATE TABLE `sfracing_tracks` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `checkpoints` text COLLATE utf8mb4_unicode_ci,
  `records` text COLLATE utf8mb4_unicode_ci,
  `creatorid` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `creatorname` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `distance` int DEFAULT NULL,
  `raceid` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

```

{% endcode %}

## Step 4 ➡ Click on [Config](/resources/sfracing/config)&#x20;


# Config

## file config.lua

Select framework, language, banking and notification system.

if your language is unavailable in the list, you can make your own translation.

{% hint style="info" %}
Set up your own banking system or use sfbanking 😉
{% endhint %}

## file config.js

Only select language.

if your language is unavailable in the list, you can make your own translation.


# Exports

## Lua code examples for Client Side

```lua
local isInRace = exports["sfracing"]:isInRace()
print(isInRace) -- return true or false
```

```lua
local isInEditor = exports["sfracing"]:isInEditor()
print(isInEditor) -- return true or false
```


# sfbanking


# 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](/resources/sfbanking/config)&#x20;


# Config

## file config.lua

Select framework, language, inventory, target and notification system.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Only select language.

if your language is unavailable in the list, you can make your own translation.


# Exports

## Lua code Trigger for Client Side

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

## Lua code examples for Server Side for MONEY

Get your bank account number:

```lua
local bank_number = exports["sfbanking"]:getNumberBankFromSource(source)
print(bank_number) -- return false if player is offline or number if player is online
```

```lua
local identifier = 'char1:4cf32ff23f23f23f32f23f32f32' -- example id
local bank_number = exports["sfbanking"]:getNumberBankFromId(identifier)
print(bank_number) -- return false if account not found or number
```

Get the amount as available in your bank account:

<pre class="language-lua"><code class="lang-lua"><strong>local bank_number = exports["sfbanking"]:getNumberBankFromSource(source)
</strong>local bank_amount = exports["sfbanking"]:getAmountBankFromNumber(bank_number)
print(bank_amount) -- return false if account not found or amount 
</code></pre>

Top up your bank account with the specified amount(type: transfer from account SYSTEM):

<pre class="language-lua"><code class="lang-lua">local bank_number = 12345 -- example
<strong>local amount = 100 -- only number > 0, must be INT! NOT FLOAT!
</strong><strong>local reason = "salary" -- can be nil
</strong>local type_log = 1 -- 1 - transfer, 2 - deposit/withdrawal, 3 - invoice payment, can be nil
local src = source -- not required, needed for logs
<strong>local result = exports["sfbanking"]:addMoneyForPlayer(bank_number, amount, reason, type_log, src)
</strong>print(result) -- return false if account not found/amount is bad or true if the transfer was successful
</code></pre>

Take cash from your bank account with the specified amount(type: transfer to account SYSTEM):

```lua
local bank_number = 12345 -- example
local amount = 100 -- only number > 0, must be INT! NOT FLOAT!
local reason = "fine" -- can be nil
local type_log = 1 -- 1 - transfer, 2 - deposit/withdrawal, 3 - invoice payment, can be nil
local src = source -- not required, needed for logs
local result = exports["sfbanking"]:removeMoneyForPlayer(bank_number, amount, reason, type_log, src)
print(result) -- return false if account not found/amount is bad or true if the transfer was successful
```

Make a transfer from bank account to account:

<pre class="language-lua"><code class="lang-lua">local from_bank_number = 12345 -- example
<strong>local to_bank_number = 12345 -- example
</strong>local amount = 100 -- only number > 0, must be INT! NOT FLOAT!
local reason = "credit" -- can be nil
local src = source -- not required, needed for logs
local result = exports["sfbanking"]:transferMoneyFromAccountToAccount(from_bank_number, to_bank_number, amount, reason, src)
print(result) -- return false if account not found/amount is bad or true if the transfer was successful
</code></pre>

Creating a bank account for a player or anything:

```lua
local src = source
local type_data = "player" -- options: "player" - for creating a player account , "SomeString" - for creating accounts for jobs or organizations, whatever you come up with. This is a prefix. 
local data = 1 -- example: id job or id organization :) cannot be nil when typedata is different than "player"
local result = exports["sfbanking"]:registerAccount(src, type_data, data)
print(result) -- return false if account not created or true if the account was created
```

Bank logs:

```lua
local bank_number = 23241 -- example
local result = exports["sfbanking"]:getBankLogs(bank_number)
print(result) -- return table with data
```

## Lua code examples for Server Side for CRYPTO

Get your crypto account number:

```lua
local crypto_number = exports["sfbanking"]:getNumberCryptoFromSource(source)
print(crypto_number) -- return false if player is offline or number if player is online
```

```lua
local identifier = 'char1:4cf32ff23f23f23f32f23f32f32' -- example id
local crypto_number = exports["sfbanking"]:getNumberCryptoFromId(identifier)
print(crypto_number) -- return false if account not found or number
```

Get the amount as available in your crypto account:

<pre class="language-lua"><code class="lang-lua"><strong>local crypto_number = exports["sfbanking"]:getNumberCryptoFromSource(source)
</strong>local currency = "OCASH" -- can be nil(return table with all currency) 
local currency_amount = exports["sfbanking"]:getAmountCryptoFromNumber(crypto_number, currency)
print(currency_amount) -- return false if account not found or amount/table
</code></pre>

Top up your crypto account with the specified amount and currency(type: transfer from account SYSTEM):

<pre class="language-lua"><code class="lang-lua">local crypto_number = 12345 -- example
local currency = "OCASH" -- example
<strong>local amount = 5.5 -- only number > 0, must be INT or FLOAT
</strong>local src = source -- not required, needed for logs
<strong>local result = exports["sfbanking"]:addCryptoForPlayer(crypto_number, currency, amount, src)
</strong>print(result) -- return false if account not found/amount is bad or true if the transfer was successful
</code></pre>

Take crypto from your crypto account with the specified amount and currency(type: transfer to account SYSTEM):

```lua
local crypto_number = 12345 -- example
local currency = "OCASH" -- example
local amount = 5.5 -- only number > 0, must be INT or FLOAT
local src = source -- not required, needed for logs
local result = exports["sfbanking"]:removeCryptoForPlayer(crypto_number, currency, amount, src)
print(result) -- return false if account not found/amount is bad/lack of account funds or true if the transfer was successful
```

Make a transfer from crypto account to account:

<pre class="language-lua"><code class="lang-lua">local from_crypto_number = 12345 -- example
<strong>local to_crypto_number = 23456 -- example
</strong>local currency = "OCASH" -- example
local amount = 100 -- only number > 0, must be INT or FLOAT
local src = source -- not required, needed for logs
local result = exports["sfbanking"]:transferCryptoFromAccountToAccount(from_crypto_number, to_crypto_number, currency, amount, src)
print(result) -- return false if account not found/amount is bad or true if the transfer was successful
</code></pre>

Crypto logs:

<pre class="language-lua"><code class="lang-lua"><strong>local crypto_number = 23241 -- example
</strong>local result = exports["sfbanking"]:getCryptoLogs(crypto_number)
print(result) -- return table with data
</code></pre>

## Lua code examples for Server Side - PERMISSIONS

Granting permissions to use other bank accounts/crypto wallet:

```lua
local bank_number = 12345 -- Bank account number, just enter your account number or crypto wallet number
local crypto_number = 0 -- wallet number, just enter crypto wallet number or your account number
local playerId = "char1:3213213" -- player id
local permission_bank = 1 -- if 1 will receive permission, if 0 then he will not have it
local permission_crypto = 0 -- if 1 will receive permission, if 0 then he will not have it
local result = exports["sfbanking"]:addPermission(bank_number, crypto_number, playerId, permission_bank, permission_crypto)
print(result) -- return true or false
```

Removing privileges to use other bank accounts/crypto wallet:

```lua
local bank_number = 12345 -- Bank account number
local crypto_number = 0 -- wallet number
local playerId = "char1:3213213" -- player id
local result = exports["sfbanking"]:removePermission(bank_number, crypto_number, playerId)
print(result) -- return true or false
```

Downloading a table with data about which accounts the player has access to:

```lua
local playerId = "char1:3213213" -- player id
local type = "bank" -- "bank" or "crypto"
local result = exports["sfbanking"]:getPermissionData(playerId, type)
print(result) -- return table
```


# sfctab


# 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 sfctab
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `crimetab` (
  `id` int(11) NOT NULL,
  `name` varchar(64) DEFAULT NULL,
  `owner` varchar(64) DEFAULT NULL,
  `date_creation` varchar(64) NOT NULL,
  `maxlimit` int(11) NOT NULL DEFAULT 6,
  `points` int(11) NOT NULL DEFAULT 0,
  `mission_active` int(11) NOT NULL DEFAULT 0,
  `mission_started` int(11) NOT NULL DEFAULT 0,
  `mission_ending` int(11) NOT NULL DEFAULT 0,
  `mission_success` int(11) NOT NULL DEFAULT 0,
  `stats` text NOT NULL DEFAULT ('{}'),
  `updates` text NOT NULL DEFAULT ('{}')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `crimetab_missions` (
  `id` int(11) NOT NULL,
  `name` varchar(512) NOT NULL,
  `description` text NOT NULL,
  `cost` int(11) NOT NULL,
  `currency` varchar(16) NOT NULL,
  `action` varchar(32) NOT NULL,
  `lasttime` varchar(64) NOT NULL DEFAULT '0',
  `active` int(11) NOT NULL DEFAULT 0,
  `waiting` int(11) NOT NULL DEFAULT 600
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `crimetab_players` (
  `id` int(11) NOT NULL,
  `playerid` varchar(64) NOT NULL,
  `crimeid` int(11) NOT NULL,
  `position` int(11) NOT NULL,
  `date_creation` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `crimetab_updates` (
  `id` int(11) NOT NULL,
  `name` varchar(512) NOT NULL,
  `description` text NOT NULL,
  `cost` int(11) NOT NULL,
  `currency` varchar(16) NOT NULL,
  `action` varchar(32) NOT NULL,
  `need` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

ALTER TABLE `crimetab` ADD PRIMARY KEY (`id`);
ALTER TABLE `crimetab_missions` ADD PRIMARY KEY (`id`);
ALTER TABLE `crimetab_players` ADD PRIMARY KEY (`id`);
ALTER TABLE `crimetab_updates` ADD PRIMARY KEY (`id`);
ALTER TABLE `crimetab` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `crimetab_missions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `crimetab_players` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `crimetab_updates` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
```

{% endcode %}

Example data:

```sql
INSERT INTO `crimetab_missions` (`id`, `name`, `description`, `cost`, `currency`, `action`, `lasttime`, `active`, `waiting`) VALUES (1, 'Preparation for Fleeca Bank #1', 'Prepare accordingly for the attack.', 5, 'OCASH', 'fleeca1', '1689009097', 1, 600);
INSERT INTO `crimetab_updates` (`id`, `name`, `description`, `cost`, `currency`, `action`, `need`) VALUES (1, 'Increasing the limit #1', 'Increases the member limit by 4 additional slots.', 20, 'OCASH', 'peoplelimit', 0), (2, 'Increasing the limit #2', 'Increases the member limit by 6 additional slots.', 30, 'OCASH', 'peoplelimit2', 1);
```

## Step 4 ➡ Click on [Config](/resources/sfctab/config)&#x20;


# Config

## file config.lua

Select framework, language, inventory and notification system.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Only select language.

if your language is unavailable in the list, you can make your own translation.


# Open tablet

{% hint style="warning" %}
I recommend ox\_inventory.
{% endhint %}

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

## For resource ox\_inventory

Add the following code in the file `ox_inventory/data/items.lua`

<pre class="language-lua"><code class="lang-lua">
<strong>['tablet'] = {
</strong>	label = 'tablet',
	weight = 500,
	stack = false,
	client = {
		export = 'ox_inventory_examples.tablet', -- if you use ox_inventory_examples 'yourscript.tablet'
	},
	consume = 0
},

</code></pre>

Add the following code in the file `ox_inventory_examples/client.lua` or `yourscript/client.lua`

```lua
exports('tablet', function(data, slot)
	exports.ox_inventory:useItem(data, function(data)
		if data then
			TriggerEvent("sfctab:tabletopen")
		end
	end)
end)
```

Add the following images to the folder `ox_inventory/web/images`&#x20;

<figure><img src="https://3417600217-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUstiQCWWtCVFlim0J8Rh%2Fuploads%2Fzm4toiguLtiyAOLsMD4f%2Ftablet.png?alt=media&amp;token=62a1f107-9056-4987-8386-a2ed6c00b72b" alt=""><figcaption><p>tablet.png</p></figcaption></figure>


# Exports // Triggers

## EXPORTS Lua code examples for Client Side

```lua
local getIdGroup = exports["sfctab"]:getMyGroup()
print(getIdGroup) -- return 0 if you havent group, return number>0 if you have group
```

```lua
local myGrade = exports["sfctab"]:getMyGrade()
print(myGrade) -- return number grade (0, 1, 2, 3, 9, 10)
```

## TRIGGERS Lua code examples for Client Side

```lua
TriggerEvent("sfctab:createnew") -- Creates a new organization if you don't belong to an organization.
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

## EXPORTS Lua code examples for Server Side

<table><thead><tr><th>Variable</th><th width="274.3333333333333">Type</th><th data-hidden></th></tr></thead><tbody><tr><td>id_mission</td><td>number</td><td></td></tr><tr><td>crime_group_id</td><td>number</td><td></td></tr></tbody></table>

<pre class="language-lua"><code class="lang-lua"><strong>local result = exports["sfctab"]:setFailedMission(id_mission, crime_group_id) -- set the mission as failed
</strong>print(result) -- return false(if an error occurred) or true
local result2 = exports["sfctab"]:setSuccessMission(id_mission, crime_group_id) -- set the mission as successful
print(result2) -- return false(if an error occurred) or true
</code></pre>

```lua
local idPlayer = "char1:xxxxx" -- for e.g.
local groupPlayer = exports["sfctab"]:getGroupPlayer(idPlayer)
print(groupPlayer) -- return 0 if player haven't group OR idGroup > 0
```

```lua
local idPlayer = "char1:xxxxx" -- for e.g.
local gradePlayer = exports["sfctab"]:getGradePlayer(idPlayer)
print(gradePlayer) -- return number grade (0, 1, 2, 3, 9, 10) if player have group or false if haven't group
```

```lua
local idGroup = 1 -- for e.g.
local result = exports["sfctab"]:removeGroup(source, idGroup)
print(result) -- return true or false
```


# sfcrafting


# 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>" %}

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

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

## 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 sfcrafting
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `crafting` (
  `id` int NOT NULL,
  `name` varchar(64) NOT NULL,
  `invid` varchar(64) NOT NULL,
  `job` varchar(128) NOT NULL,
  `itemid` varchar(64) NOT NULL,
  `products` text NOT NULL,
  `display` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `crafting` ADD PRIMARY KEY (`id`);
ALTER TABLE `crafting` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

```

{% endcode %}

Example data for crafting tables:

```sql
INSERT INTO `crafting` (`name`, `invid`, `job`, `itemid`, `products`, `display`) VALUES ('table2', 'client', 'none', 'cocaine', '[{\"amount\":\"1\",\"item\":\"drug_white\"}]', 0);
INSERT INTO `crafting` (`name`, `invid`, `job`, `itemid`, `products`, `display`) VALUES ('table1', 'client', 'none', 'heartstopper', '[ {\"amount\":\"1\",\"item\":\"bun\"},{\"amount\":\"3\",\"item\":\"patty\"},{\"amount\":\"3\",\"item\":\"cheese\"},{\"amount\":\"1\",\"item\":\"tomato\"},{\"amount\":\"1\",\"item\":\"lettuce\"},{\"amount\":\"1\",\"item\":\"sauce\"}, ]', 1);
```

## Step 4 ➡ Click on [Config](/resources/sfcrafting/config)&#x20;


# Config

## file config.lua

Select framework, language, inventory, target and notification system.

if your language is unavailable in the list, you can make your own translation.

You can create targeting options in the config file or implement them yourself.

<figure><img src="https://3417600217-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUstiQCWWtCVFlim0J8Rh%2Fuploads%2F1k5VWhIbNvdGE80ENWFb%2Fobraz_2023-07-24_213545567.png?alt=media&amp;token=8de07475-f474-4662-aa37-20f65593a7a5" alt=""><figcaption></figcaption></figure>

## file config.js

Only select language.

if your language is unavailable in the list, you can make your own translation.


# Open crafting table

## TRIGGERS Lua code examples for Client Side

```lua
local name_table = "table1"
local job = "none"
local name_inv = "client"
TriggerEvent("sfcrafting:openCrafting", name_table, job, name_inv)
```

```lua
local name_table = "table2"
local job = "burgershot"
local name_inv = "burgershot-warehouse"
TriggerEvent("sfcrafting:openCrafting", name_table, job, name_inv)
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```


# sfnotify


# Installations

## Step 1 ➡ Resources in server.cfg

```
ensure sfnotify
```

## Step 2 ➡ Click on [Config](/resources/sfnotify/config)&#x20;


# Config

## file config.js

Select language and style - dark or light.

if your language is unavailable in the list, you can make your own translation.\
You can also set your own notification icons with fontawesome.


# Exports // Triggers

| Variable | Type              | Example                                 |
| -------- | ----------------- | --------------------------------------- |
| type     | string            | info, error, success, twitter, dispatch |
| message  | string            | Test message                            |
| header   | string or boolean | 10-13a, Some text or false              |
| time     | number            | 20000                                   |

## Lua code examples for Client Side

```lua
exports["sfnotify"]:notify(type, message, header, time)

-- examples, default time is 10000
exports["sfnotify"]:notify("info", "test message")
exports["sfnotify"]:notify("info", "test message", false, 5000)
exports["sfnotify"]:notify("info", "test message", "Notification")
```

```lua
TriggerEvent("sfnotify", "dispatch", "test message", "10-13a")
```

```lua
TriggerEvent("sfnotify:cinematic", true) -- if set true notifications do not show
TriggerEvent("sfnotify:cinematic", false) -- if set false notifications show up
```

## Lua code examples for Server Side

```lua
TriggerClientEvent("sfnotify", source, "info", "test message")
```


# sfjob


# 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 sfjob
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `jobs_players` (
  `id` int(11) NOT NULL,
  `playerid` varchar(64) NOT NULL,
  `workname` varchar(64) NOT NULL,
  `position` int(11) NOT NULL DEFAULT 0,
  `worktime` int(11) NOT NULL DEFAULT 0,
  `worktime_all` int(11) NOT NULL DEFAULT 0,
  `worktime_payout` int(11) NOT NULL DEFAULT 0,
  `date_creation` varchar(64) NOT NULL,
  `datestart` int(14) NOT NULL,
  `active` int(2) NOT NULL DEFAULT 0,
  `whoadd` varchar(64) NOT NULL,
  `other` text NOT NULL DEFAULT ('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_positions` (
  `id` int(11) NOT NULL,
  `workname` varchar(64) NOT NULL,
  `position` int(11) NOT NULL,
  `label` varchar(64) NOT NULL,
  `money` int(32) NOT NULL,
  `permissions` text NOT NULL DEFAULT ('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_settings` (
  `id` int(11) NOT NULL,
  `workname` varchar(64) NOT NULL,
  `name` varchar(64) NOT NULL,
  `date_creation` varchar(64) NOT NULL,
  `maxlimit` int(11) NOT NULL DEFAULT 6,
  `updates` varchar(4096) NOT NULL DEFAULT ('{}'),
  `system` int(2) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_products` (
  `id` int(11) NOT NULL,
  `workname` varchar(64) NOT NULL,
  `product` varchar(64) NOT NULL,
  `price` int(11) NOT NULL,
  `list` varchar(4096) NOT NULL DEFAULT ('[]'),
  `points` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_announcements` (
  `id` int(11) NOT NULL,
  `title` varchar(256) NOT NULL,
  `message` text NOT NULL,
  `who` varchar(128) NOT NULL,
  `date` varchar(64) NOT NULL,
  `workname` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `jobs_invoices` (
  `id` int(11) NOT NULL,
  `fromnumber` int(11) NOT NULL,
  `tonumber` int(11) NOT NULL,
  `amount` int(11) NOT NULL,
  `reason` varchar(512) NOT NULL,
  `who` varchar(64) NOT NULL,
  `date` varchar(64) NOT NULL,
  `workname` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `jobs_updates` (
  `id` int(11) NOT NULL,
  `name` varchar(256) NOT NULL,
  `description` varchar(512) NOT NULL,
  `cost` int(11) NOT NULL,
  `action` varchar(64) NOT NULL,
  `need` int(11) DEFAULT 0,
  `workname` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `sf_customproperties` (
  `id` int(11) NOT NULL,
  `stash` varchar(256) NOT NULL,
  `slots` int(11) NOT NULL,
  `weight` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_points` (
  `id` int(11) NOT NULL,
  `identifier` varchar(64) NOT NULL,
  `points` text NOT NULL DEFAULT('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `jobs_players` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `jobs_positions` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `jobs_settings` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `jobs_products` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `jobs_announcements` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `jobs_invoices` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `jobs_updates` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `sf_customproperties` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_points` ADD PRIMARY KEY (`id`);

ALTER TABLE `jobs_players` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_positions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_settings` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_announcements` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_invoices` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_updates` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `sf_customproperties` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `jobs_points` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
```

{% endcode %}

Example data:

```sql
INSERT INTO `jobs_products` (`workname`, `product`, `price`, `list`) VALUES
('burgershot', 'Kit Mini', 13, '[{ \"product\": \"hotdog\", \"amount\": 1 }, { \"product\": \"water\", \"amount\": 1 }]'),
('burgershot', 'bsfries', 8, '[]');
INSERT INTO `jobs_updates` (`name`, `description`, `cost`, `action`, `need`, `workname`) VALUES
('Increased employee limit (+4)', 'Hire more employees in your business.', 1000, 'people1', 0, 'all'),
('Increased employee limit (+5)', 'Hire more employees in your business.', 5000, 'people2', 1, 'burgershot');
```

## Step 4 ➡ Click on [Config](/resources/sfjob/config)&#x20;


# Config

## file config.lua

Select framework, language, inventory, banking, target and notification system.

Also set the percentage of earnings that the employee should receive at work.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language and set description for jobs in Job Center.

if your language is unavailable in the list, you can make your own translation.


# Exports // Triggers

## EXPORTS Lua code examples for Client Side

```lua
local myjobs = exports["sfjob"]:getMyJobs()
print(myjobs) -- return table e.g: { [1] = { ["name"] = Burger Shot,["workname"] = burgershot,["position"] = 10,} ,[2] = { ["name"] = Bean Machine,["workname"] = beanmachine,["position"] = 10,} ,}
```

```lua
local myjob = exports["sfjob"]:getActiveJob()
print(myjob) -- return string e.g: "farm"
```

```lua
local myjobgrade = exports["sfjob"]:getActiveJobGrade()
print(myjobgrade) -- return number e.g: 0
```

```lua
local job_name = "burgershot"
local id_cash = 1
exports["sfjob"]:cashRegister(job_name, id_cash) -- open cash register for employees and customers
```

```lua
local job_name = "burgershot"
local id_tray = 1
exports["sfjob"]:orderTray(job_name, id_tray) -- open tray for employees and customers
```

```lua
local job_name = "burgershot"
local displayname = "Stash Main"
local id_stash = 1
local places = 50
local weight = 100000
local grade = 1
exports["sfjob"]:openStash(job_name, displayname, id_stash, places, weight, grade) -- Opening the cupboard/fridge with things.
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

## EXPORTS Lua code examples for Server Side

```lua
local player_jobs = exports["sfjob"]:getJobsFromSource(source)
print(player_jobs) -- return table e.g: { [1] = { ["workname"] = burgershot,["position"] = 10,["name"] = Burger Shot,} ,[2] = { ["workname"] = beanmachine,["position"] = 10,["name"] = Bean Machine,} ,} 
```

```lua
local player_job, player_grade = exports["sfjob"]:getJobFromSource(source)
print(player_job) -- return active job for player
print(player_grade) -- return grade active job for player
```

```lua
local player_id = "char1:00000000000"
local player_job, player_grade = exports["sfjob"]:getJobFromId(player_id)
print(player_job) -- return active job for player
print(player_grade) -- return grade active job for player
```

```lua
local job_name = "unemployed" -- or "burgershot" or anything else. when set to "unemployed", it will exclude you from your current job.
local result = exports["sfjob"]:setActiveJob(job_name, source) -- sets the active job for the player, return true or false
```

```lua
local job_name = "burgershot"
local nameJob = exports["sfjob"]:getJobName(job_name)
print(nameJob) -- return e.g.: "Burger Shot"
```

<pre class="language-lua"><code class="lang-lua">local job_name = "burgershot"
local src_data = 11 -- server id of the player you want to hire
<strong>local result = exports["sfjob"]:addNewJob(source, job_name, src_data) -- hire an employee, if src_data is empty hire yourself
</strong><strong>print(result) -- return true or false(if hiring was unsuccessful)
</strong></code></pre>

<pre class="language-lua"><code class="lang-lua">local job_name = "burgershot"
local id_player = "char1:0000000000" -- the id of the player you want to fire.(not server id)
local new_position = 2 -- e.g.
<strong>exports["sfjob"]:updatePosition(job_name, id_player, new_position) -- change player rank, all fields must be filled. return true or false
</strong></code></pre>

```lua
local job_name = "burgershot"
local id_player = "char1:0000000000" -- the id of the player you want to fire.(not server id)
exports["sfjob"]:dropFromJob(source, job_name, id_player) -- dismiss an employee, if id_player is left blank you will fire yourself. return true or false
```

```lua
local job_name = "police"
local count = exports["sfjob"]:countPlayersInJob(job_name)
print(count) -- returns the number of people actively working
```

```lua
local stash_id = "police-armory"
local add_slots = 50
local add_weight = 100000
exports["sfjob"]:setCustomStash(stash_id, add_slots, add_weight)
```

<pre class="language-lua"><code class="lang-lua">local job_name = "burgershot"
local id_player = "char1:1234567"
<strong>local new_position = 10
</strong>local result = exports["sfjob"]:updatePosition(job_name, id_player, new_position)
print(result) -- return true or false
</code></pre>

```lua
-- increasing the employee limit (current limit + 4)
local job_name = "burgershot"
local what = "maxlimit"
local data = 4 
local result = exports["sfjob"]:changeDataSettingsJob(job_name, what, data)
print(result) -- return true or false

-- saving the purchased/received update for the indicated company
local job_name = "burgershot"
local what = "updates"
local data = 4 -- id update'u
local result = exports["sfjob"]:changeDataSettingsJob(job_name, what, data)
print(result) -- return true or false

-- change in remuneration for a given rank in a given company
local job_name = "burgershot"
local what = "money"
local data = {}
data.position = 10 -- id rank
data.permissions = {} -- data must always be in the table
local result = exports["sfjob"]:changeDataSettingsJob(job_name, what, data)
print(result) -- return true or false

-- adding a product/set for a given company
local job_name = "burgershot"
local what = "addProduct"
local data = {}
data.kit_name = "Big Kit" -- set name or item id
data.kit_price = 100 -- price of the set/product
data.kit_products = {} -- data must always be in the table, if the table is empty, kit_name must contain the item id
local productList = {}
productList.product = "burger"
productList.amount = 1
table.insert(data.kit_products, productList)
local result = exports["sfjob"]:changeDataSettingsJob(job_name, what, data)
print(result) -- return true or false

-- deleting a product/kit for a given company
local job_name = "burgershot"
local what = "removeProduct"
local data = 3 -- product/set id
local result = exports["sfjob"]:changeDataSettingsJob(job_name, what, data)
print(result) -- return true or false
```

```lua
-- receiving the current employee limit from the indicated company
local job_name = "burgershot"
local what = "maxlimit"
local result = exports["sfjob"]:getDataSettingsJob(job_name, what)
print(result) -- return number (e.g.: 6) or false

-- receiving purchased/received upgrades from the indicated company
local job_name = "burgershot"
local what = "updates"
local result = exports["sfjob"]:getDataSettingsJob(job_name, what)
print(result) -- return table or false

-- receiving data of all employees from the indicated company
local job_name = "burgershot"
local what = "jobs_players"
local result = exports["sfjob"]:getDataSettingsJob(job_name, what)
print(result) -- return table or false

-- receiving data of all ranks from the indicated company
local job_name = "burgershot"
local what = "jobs_products"
local result = exports["sfjob"]:getDataSettingsJob(job_name, what)
print(result) -- return table or false

-- receiving information whether the specified company pays remuneration in the bank - if so returns true. 
local job_name = "burgershot"
local what = "withdrawalFromBankInfo"
local result = exports["sfjob"]:getDataSettingsJob(job_name, what)
print(result) -- return true or false

-- receiving information whether the cost of remuneration is covered by the company (return true) or the server (return false)
local job_name = "burgershot"
local what = "withdrawalFromCompanyAccount"
local result = exports["sfjob"]:getDataSettingsJob(job_name, what)
print(result) -- return true or false

-- receiving information about the salary for a particular rank in the company
local job_name = "burgershot"
local what = "money"
local position = 10 
local result = exports["sfjob"]:getDataSettingsJob(job_name, what, position)
print(result) -- return number (e.g.: 100) or false

-- receiving information about the rights of a particular rank in the company
local job_name = "burgershot"
local what = "permissions"
local position = 10
local result = exports["sfjob"]:getDataSettingsJob(job_name, what, position)
print(result) -- return number (e.g.: 100) or false
```

```lua
-- changing player data in the other column. e.g.: you can save the badge number here
local job_name = "burgershot"
local what = "other"
local id_player = "char1:123456789"
local data = {} -- always table with data
local result = exports["sfjob"]:changeDataPlayerJob(job_name, what, id_player, data)
print(result) -- return true or false
```

```lua
-- receiving all player data from the indicated company
local job_name = "burgershot"
local player_id = "char1:123456"
local result = exports["sfjob"]:getDataPlayerJob(job_name, player_id)
print(result) -- return table with data or false
```

```lua
-- paying the player's salary from the indicated company if payment from the bank is disabled
local src = source -- source of the person who pays the bonuses
local job_name = "burgershot"
local player_id = "char1:123456"
local result = exports["sfjob"]:payoutBonus(job_name, player_id, src)
print(result) -- return true or false
```

<pre class="language-lua"><code class="lang-lua"><strong>-- resetting employee working hours for a given company
</strong>local job_name = "burgershot"
local result = exports["sfjob"]:resetTimework(job_name)
print(result) -- return true or false
</code></pre>

<pre class="language-lua"><code class="lang-lua"><strong>-- generating player data from jobs to excel
</strong>local job_name = "burgershot"
local webook = "https://discord.com/api/webhooks/"
local options = { name=true, position=true, worktime=true, worktime_all=true, date_creation=true, unit=true, badge=true, specializations=true, stats=true, }
exports["sfjob"]:generateExcel(job_name, webhook, options)
</code></pre>

<pre class="language-lua"><code class="lang-lua"><strong>-- saving players stats in job
</strong>local source = 1
local job_name = "burgershot"
local type_stats = "cleaning" -- type of statistics
local amount = 1 -- quantity to be added (+1)
exports["sfjob"]:setStats(source, job_name, type_stats, amount)
</code></pre>

Event Handler for collecting paycheck in bank:

```lua
AddEventHandler('sfjob:infoPaycheck', function(source, money, workname)
    print("Player "..source.." received $"..money.." from his job as a "..workname)
end)
```


# sfjobtab


# 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>" %}

{% embed url="<https://store.scriptsfivem.com/package/5834252>" %}

## 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 %}

**sfjobtab** must be run behind **sfjob**. The correct order of resources is:

```
ensure sfjob
ensure sfjobtab
```

## Step 3 ➡ Click on [Config](/resources/sfjobtab/config)&#x20;


# Config

## file config.lua

Select framework, language, inventory, banking, target and notification system.

Add work that you want to have access to the tablet.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language.

if your language is unavailable in the list, you can make your own translation.


# Triggers

## TRIGGERS Lua code examples for Client Side

```lua
TriggerEvent("sfjobtab:tabletopen") -- open job tablet
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```


# sfgps


# 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/ox_inventory>" %}

{% embed url="<https://store.scriptsfivem.com/package/5834252>" %}

## 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 sfgps
```

## Step 3 ➡ Add item to ox\_inventory&#x20;

In the install-need-data folder you will find the icon and item.

## Step 4 ➡ Click on [Config](/resources/sfgps/config)&#x20;


# Config

## file config.lua

Select framework, language, and notification system.

Add work that you want to have access to gps system.

You can also change the color, scale, prefix and image of the blip.<br>

if your language is unavailable in the list, you can make your own translation.


# Exports

## EXPORTS Lua code examples for Server Side

<pre class="language-lua"><code class="lang-lua"><strong>local netIdEntity = 12345 -- e.g. vehicle id server/player source
</strong>local name = "trucker" -- example set for "trucker" in config.lua
local nameDisplay = "Stolen vehicle with a GPS transmitter"
exports["sfgps"]:registerOtherBlip(netIdEntity, name, nameDisplay)
</code></pre>

```lua
local netIdEntity = 12345 -- e.g. vehicle id server/player source
exports["sfgps"]:removeOtherBlip(netIdEntity)
```


# sfpolice


# 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>" %}

{% embed url="<https://github.com/citizenfx/screenshot-basic>" %}

{% embed url="<https://github.com/mkafrin/PolyZone>" %}
pre-configured for PolyZone in client\_editable.lua/server\_editable.lua
{% endembed %}

{% embed url="<https://github.com/overextended/ox_lib>" %}
pre-configured for ox\_lib in client\_editable.lua/server\_editable.lua
{% endembed %}

{% embed url="<https://store.scriptsfivem.com/package/5834252>" %}

### Not required but recommended:

{% embed url="<https://github.com/overextended/ox_inventory>" %}
pre-configured for ox\_inventory in client\_editable.lua/server\_editable.lua
{% endembed %}

## 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, sfjob</mark> and its cores above, but the other normal resources below

```
ensure sfpolice
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `jobs_police_cars` (
  `id` int(11) NOT NULL,
  `plate` varchar(16) NOT NULL,
  `status` text NOT NULL DEFAULT ('[]'),
  `notes` text NOT NULL DEFAULT ('[]'),
  `towtruck` text NOT NULL DEFAULT ('[]'),
  `historyowner` text NOT NULL DEFAULT ('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_police_category` (
  `id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_police_matters` (
  `id` int(11) NOT NULL,
  `title` varchar(128) NOT NULL,
  `date` varchar(32) NOT NULL,
  `date_create` varchar(32) NOT NULL,
  `whoAdd` varchar(64) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `citizens` text NOT NULL DEFAULT ('[]'),
  `officers` text NOT NULL DEFAULT ('[]'),
  `cars` text NOT NULL DEFAULT ('[]'),
  `photos` text NOT NULL DEFAULT ('[]'),
  `message` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_police_otherdata` (
  `lastWantedPeoples` text NOT NULL DEFAULT ('[]'),
  `lastWantedCars` text NOT NULL DEFAULT ('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO `jobs_police_otherdata` (`lastWantedPeoples`, `lastWantedCars`) VALUES ('[]', '[]');

CREATE TABLE `jobs_police_players` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `avatar` varchar(1024) DEFAULT NULL,
  `status` text NOT NULL DEFAULT ('[]'),
  `notes` text NOT NULL DEFAULT ('[]'),
  `historyJudgments` text NOT NULL DEFAULT ('[]'),
  `fingerprint` int(2) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_police_regulations` (
  `id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `category` int(11) NOT NULL,
  `money` int(11) NOT NULL,
  `time` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `sf_customstash` (
  `id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `job` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_police_evidenceItems` (
  `id` int(11) NOT NULL,
  `item` varchar(64) NOT NULL,
  `name` varchar(128) NOT NULL,
  `serial` varchar(64) NOT NULL,
  `date` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `jobs_police_cars` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_police_category` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_police_matters` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_police_players` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_police_regulations` ADD PRIMARY KEY (`id`);
ALTER TABLE `sf_customstash` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_police_evidenceItems` ADD PRIMARY KEY (`id`);

ALTER TABLE `jobs_police_cars` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_police_category` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_police_matters` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_police_players` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_police_regulations` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `sf_customstash` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_police_evidenceItems` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;;
```

{% endcode %}

Example data:

```sql
INSERT INTO `jobs_police_category` (`id`, `name`) VALUES
(1, 'Traffic offenses'),
(2, 'Other');
```

A `vin` column should be added to the table with vehicles. For example, in ESX, in the `owned_vehicles` table, add the `vin` column varchar(32) not null.

```sql
ALTER TABLE `owned_vehicles` ADD `vin` varchar(32) NOT NULL AFTER `plate`;
```

## Step 4 ➡ folder install-need-data

Copy the data to the appropriate scripts or database, everything is described there.

## Step 5 ➡ folder install-need-data

Add the VIN number generation code to the script where the vehicle can be purchased so that the VIN number is generated (in the script, e.g.: esx\_vehicleshop)

```lua
function GenerateVIN()
	local foundNumber = false
	local vin = nil
	while not foundNumber do
		vin = makeid(16)
		local result = exports.oxmysql:executeSync('SELECT COUNT(*) AS `count` FROM `owned_vehicles` WHERE `vin`=@info',{['@info'] = vin})
		local count  = tonumber(result[1].count)
		if count == 0 then
		  foundNumber = true
		end
	end
	return vin
end

local charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
math.randomseed(os.time())
function makeid(length)
	local ret = {}
	local r
	for i = 1, length do
		r = math.random(1, #charset)
		table.insert(ret, charset:sub(r, r))
	end
	return table.concat(ret)
end
```

## Step 6 ➡ Click on [Config](/resources/sfpolice/config)&#x20;


# Config

## file config.lua

Select framework, language, banking, inventory and notification system.

Set up a webhook for photos.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language. if your language is unavailable in the list, you can make your own translation.\
\
Also set up units, patrol units, add licenses and set vehicle statuses.

## file server\_editable.lua

In function `sendToJail`  add a trigger to send the player to prison.


# Exports/Triggers

## TRIGGERS/EXPORTS Lua code examples for Client Side

```lua
TriggerEvent("sfpolice:tabletopen") -- open police tablet
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

<pre class="language-lua"><code class="lang-lua"><strong>local result = exports["sfpolice"]:bodyCamStatus()
</strong><strong>return result -- true(BC is enable) or false(BC is disable)
</strong></code></pre>

<pre class="language-lua"><code class="lang-lua"><strong>local coords = vec4(0.0, 0.0, 0.0, 0.0) -- vec3(x, y, z) or vec4(x, y, z, w)
</strong><strong>local maxSeconds = false -- false or time in seconds f.g.: 
</strong><strong>exports["sfpolice"]:setFingerprint(coords, maxSeconds)
</strong></code></pre>

## EXPORTS Lua code examples for Server Side

```lua
local jobs = { "police", "ems" } -- what units should receive dispatch
local street = "XYZ" -- The street where the report was sent from or false
local code = "ROB" -- Report code
local gps = vector3(0.0, 0.0, 0.0) -- The location where the report was sent from
local description= "Shop robbery" -- example
local blipData = {
	sprite = 161,
	color = 43,
	scale = 0.8,
	label = '# Shop robbery',
	timeInSeconds = 60, -- how long the blip should be displayed on the map (in seconds)
} -- blipData can be false
local source = false -- source player or false - if you provide the source, the police officer will be able to respond to the report on dispatch
local limit = 10 -- number or nil - displays the limit of police officers for a given report
exports["sfpolice"]:sendDispatch(jobs, street, code, gps, description, blipData, source, limit)
```

In your radio script, add export so that the tablet shows data on which radio the officer is on

```lua
local source = source
local channel = 1 -- for e.g.
exports["sfpolice"]:setChannelRadio(source, channel)
```

Checking the number of officers who have the status 'available'

```lua
exports["sfpolice"]:getFreePolice()
```

To imprint player fingerprints on a surface you can use this function

<pre class="language-lua"><code class="lang-lua">local coords = vec4(0.0, 0.0, 0.0, 0.0) -- vec3(x, y, z) or vec4(x, y, z, w)
local maxSeconds = false -- false or time in seconds f.g.: 60
<strong>exports["sfpolice"]:setFingerprint(source, coords, maxSeconds)
</strong></code></pre>


# sfems


# 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>" %}

{% embed url="<https://store.scriptsfivem.com/package/5834252>" %}

{% embed url="<https://store.scriptsfivem.com/package/6033988>" %}

### Not required but recommended:

{% embed url="<https://github.com/mkafrin/PolyZone>" %}
pre-configured for PolyZone in client\_editable.lua/server\_editable.lua
{% endembed %}

{% embed url="<https://github.com/overextended/ox_lib>" %}
pre-configured for ox\_lib in client\_editable.lua/server\_editable.lua
{% endembed %}

{% embed url="<https://github.com/overextended/ox_inventory>" %}
pre-configured for ox\_inventory in client\_editable.lua/server\_editable.lua
{% endembed %}

## 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, sfjob</mark> and its cores above, but the other normal resources below

```
ensure sfems
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `jobs_ems_category` (
  `id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_ems_otherdata` (
  `lastTreatments` text NOT NULL DEFAULT('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO `jobs_ems_otherdata` (`lastTreatments`) VALUES
('[]');

CREATE TABLE `jobs_ems_players` (
  `id` int(11) NOT NULL,
  `cid` varchar(64) NOT NULL,
  `notes` text NOT NULL DEFAULT('[]'), 
  `recipes` text NOT NULL DEFAULT('[]'),
  `historyJudgments` text NOT NULL DEFAULT('[]'),
  `isDead` int(1) NOT NULL DEFAULT 0,
  `hp` int(4) NOT NULL DEFAULT 200,
  `playerDamages` text NOT NULL DEFAULT('[]'),
  `playerDamagesInfo` text NOT NULL DEFAULT('[]')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_ems_regulations` (
  `id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `category` int(11) NOT NULL,
  `money` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `jobs_ems_category` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_ems_players` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_ems_regulations` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_ems_category` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_ems_players` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_ems_regulations` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
```

{% endcode %}

Example data:

```sql
INSERT INTO `jobs_ems_category` (`name`) VALUES
('General wounds'),
('Other');
```

## Step 4 ➡ folder install-need-data

Copy the data to the appropriate scripts or database, everything is described there.

## Step 5 ➡ Click on [Config](/resources/sfems/config)


# Config

## file config.lua

Select framework, language, banking, inventory and notification system.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language. if your language is unavailable in the list, you can make your own translation.\
\
Also set up specializations and set vehicle statuses.


# Exports/Triggers

## TRIGGERS Lua code examples for Client Side

```lua
TriggerEvent("sfems:tabletopen") -- open ems tablet
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

```lua
local result = exports["sfems"]:bodyCamStatus()
return result -- true(BC is enable) or false(BC is disable)
```

## EXPORTS Lua code examples for Server Side

```lua
local source = source
exports["sfems"]:revivePlayer(source)
```

In your radio script, add export so that the tablet shows data on which radio the doctor is on

```lua
local source = source
local channel = 1 -- for e.g.
exports["sfems"]:setChannelRadio(source, channel)
```


# sfgarages


# 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>" %}

### Not required but recommended:

{% embed url="<https://github.com/overextended/ox_lib>" %}
pre-configured for ox\_lib in client\_editable.lua/server\_editable.lua
{% endembed %}

{% embed url="<https://github.com/overextended/ox_inventory>" %}
pre-configured for ox\_inventory in client\_editable.lua/server\_editable.lua
{% endembed %}

## 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 sfgarages
```

## Step 3 ➡ Database

Run query/SQL query and paste below code.

In the case of the ESX framework. For another framework, modify the query according to the name of the table and columns.

{% code fullWidth="false" %}

```sql
ALTER TABLE `vehicles` ADD `class` VARCHAR(2) NULL DEFAULT NULL AFTER `category`;
ALTER TABLE `owned_vehicles` ADD `vin` VARCHAR(32) NOT NULL AFTER `stored`, ADD `co-owner` VARCHAR(46) NULL DEFAULT NULL AFTER `vin`;
```

{% endcode %}

## Step 4 ➡ Click on [Config](/resources/sfgarages/config)


# Config

## file config.lua

Select framework, language.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language. if your language is unavailable in the list, you can make your own translation.\
\
Also set up vehicle statuses.


# Exports/Triggers

## TRIGGERS Lua code examples for Client Side

```lua
local type_garage = "vehicle" -- options: "vehicle", "boat", "plate"
TriggerEvent("sfgarages:openGarage", type_garage) -- open ems tablet
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

## EXPORTS Lua code examples for Client Side

e.g. Useful for radial menus.

```lua
local type_garage = "vehicle" -- options: "vehicle", "boat", "plate"
local result = exports["sfgarages"]:searchGarage(type_garage)
return result -- return true or false
```


# sfdoj


# 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>" %}

{% embed url="<https://store.scriptsfivem.com/package/5834252>" %}

{% embed url="<https://store.scriptsfivem.com/package/6033988>" %}

### Not required but recommended:

{% embed url="<https://github.com/overextended/ox_inventory>" %}
pre-configured for ox\_inventory in client\_editable.lua/server\_editable.lua
{% endembed %}

## 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, sfjob, sfpolice</mark> and its cores above, but the other normal resources below

```
ensure sfdoj
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `jobs_doj_category` (
  `id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `jobs_doj_regulations` (
  `id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `category` int(11) NOT NULL,
  `money` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `jobs_doj_category` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_doj_regulations` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_doj_category` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `jobs_doj_regulations` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
```

{% endcode %}

Example data:

```sql
INSERT INTO `jobs_doj_category` (`id`, `name`) VALUES
(1, 'General wounds'),
(2, 'Other');
```

A `co-owner` column should be added to the table with vehicles. For example, in ESX, in the `owned_vehicles` table, add the `co-owner` column varchar(46) default null.

```sql
ALTER TABLE `owned_vehicles` ADD `co-owner` VARCHAR(46) NULL DEFAULT NULL AFTER `vin`;
```

## Step 4 ➡ folder install-need-data

Copy the data to the appropriate scripts or database, everything is described there.

## Step 5 ➡ Click on [Config](/resources/sfdoj/config)&#x20;


# Config

## file config.lua

Select framework, language, banking, inventory and notification system.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language. if your language is unavailable in the list, you can make your own translation.\
\
Also set up licenses and set vehicle statuses.

## file server\_editable.lua

In function `sendToJail`  add a trigger to send the player to prison.

Set up a webhook for excel files.


# Exports/Triggers

## TRIGGERS/EXPORTS Lua code examples for Client Side

```lua
TriggerEvent("sfdoj:tabletopen") -- open police tablet
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```

## EXPORTS Lua code examples for Server Side

```lua
exports["sfdoj"]:getOnlinePlayers()
-- return table with data (source, fullname, phone_number, grade) 
```

In your radio script, add export so that the tablet shows data on which radio the officer is on

```lua
local source = source
local channel = 1 -- for e.g.
exports["sfdoj"]:setChannelRadio(source, channel)
```


# sffishing


# 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>" %}

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

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

## 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 sffishing
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `sffishing` (
  `id` int(11) NOT NULL,
  `playerid` varchar(64) NOT NULL,
  `exp` int(11) NOT NULL,
  `level` int(11) NOT NULL,
  `catalog` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `sffishing` ADD PRIMARY KEY (`id`);
ALTER TABLE `sffishing` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
```

{% endcode %}

## Step 4 ➡ folder install-need-data

Copy the data to the appropriate scripts, everything is described there.

## Step 5 ➡ Click on [Config](/resources/sffishing/config)&#x20;


# Config

## file config.lua

Select framework, language,  inventory and notification system.

You can also set prices for selling fish, the required level for a given fishing spot, change the chances of catching fish, and change the exp received for a caught fish.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language. if your language is unavailable in the list, you can make your own translation.<br>


# Triggers

## TRIGGERS Lua code examples for Client Side

```lua
TriggerEvent("sffishing:tabletopen") -- open fishing tablet
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```


# sfvehicleshop


# 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>" %}

{% embed url="<https://github.com/overextended/ox_inventory>" %}
Recommended but not required, you can configure the script for your own resources
{% endembed %}

## 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 sfvehicleshop
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% tabs %}
{% tab title="ESX" %}

```sql
ALTER TABLE `vehicles` ADD `class` VARCHAR(2) NULL DEFAULT NULL AFTER `category`, ADD `shop` VARCHAR(16) NOT NULL DEFAULT 'vehicle' AFTER `class`, ADD `display` INT(2) NOT NULL DEFAULT '1' AFTER `shop`, ADD `limitSold` INT(11) NOT NULL DEFAULT '0' AFTER `display`, ADD `sold` INT(11) NOT NULL DEFAULT '0' AFTER `limitSold`;

CREATE TABLE `vehicle_classes` (
  `name` varchar(60) NOT NULL,
  `label` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicle_classes` ADD PRIMARY KEY (`name`);

INSERT INTO `vehicle_classes` (`name`, `label`) VALUES
('A', 'Class A'),
('B', 'Class B'),
('C', 'Class C'),
('D', 'Class D'),
('E', 'Class E'),
('F', 'Class F'),
('S', 'Class S'),
('S+', 'Class S+');
```

{% endtab %}

{% tab title="QBCore" %}
{% code fullWidth="false" %}

```sql
CREATE TABLE `vehicle_categories` (
  `name` varchar(60) NOT NULL,
  `label` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicle_categories` ADD PRIMARY KEY (`name`);

CREATE TABLE `vehicle_classes` (
  `name` varchar(60) NOT NULL,
  `label` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicle_classes` ADD PRIMARY KEY (`name`);

CREATE TABLE `vehicles` (
  `id` int(11) NOT NULL,
  `name` varchar(60) NOT NULL,
  `model` varchar(60) NOT NULL,
  `price` int(11) NOT NULL,
  `category` varchar(60) DEFAULT NULL,
  `class` varchar(2) DEFAULT NULL,
  `shop` varchar(16) NOT NULL DEFAULT 'vehicle',
  `display` int(2) NOT NULL DEFAULT 1,
  `limitSold` int(11) NOT NULL DEFAULT 0,
  `sold` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicles` ADD PRIMARY KEY (`id`);
ALTER TABLE `vehicles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

INSERT INTO `vehicle_categories` (`name`, `label`) VALUES
('compacts', 'Compacts'),
('coupes', 'Coupés'),
('motorcycles', 'Motos'),
('muscle', 'Muscle'),
('offroad', 'Off Road'),
('sedans', 'Sedans'),
('sports', 'Sports'),
('sportsclassics', 'Sports Classics'),
('super', 'Super'),
('suvs', 'SUVs'),
('vans', 'Vans');

INSERT INTO `vehicle_classes` (`name`, `label`) VALUES
('A', 'Class A'),
('B', 'Class B'),
('C', 'Class C'),
('D', 'Class D'),
('E', 'Class E'),
('F', 'Class F'),
('S', 'Class S'),
('S+', 'Class S+');
```

{% endcode %}

Example data:

```sql
INSERT INTO `vehicles` (`name`, `model`, `price`, `category`, `class`, `shop`, `display`, `limitSold`, `sold`) VALUES
('Adder', 'adder', 90000, 'super', 'A', 'vehicle', 1, 2, 2),
('Akuma', 'AKUMA', 7500, 'motorcycles', NULL, 'vehicle', 1, 1, 1),
('Alpha', 'alpha', 60000, 'sports', NULL, 'vehicle', 1, 0, 0),
('Speeder', 'speeder', 220000, 'boat', '', 'boat', 1, 0, 0),
('Tug', 'tug', 210000, 'boat', '', 'boat', 1, 0, 0),
('Nimbus', 'nimbus', 1000000, 'plane', '', 'plane', 1, 0, 0),
('Miljet', 'miljet', 2000000, 'plane', '', 'plane', 1, 0, 0),
('Luxor', 'luxor', 3000000, 'plane', '', 'plane', 1, 0, 0),
('SuperVolito', 'supervolito', 1000000, 'plane', '', 'plane', 1, 0, 0),
('Police', 'police', 10000, 'police', 'B', 'vehiclePolice', 1, 0, 1);
```

{% endtab %}
{% endtabs %}

## Step 4 ➡ Click on [Config](/resources/sfvehicleshop/config)&#x20;


# Config

## file config.lua

Select framework, language, inventory, banking, job and notification system.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language. if your language is unavailable in the list, you can make your own translation.<br>


# sfmechanic


# 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>" %}

{% embed url="<https://github.com/mkafrin/PolyZone>" %}

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

{% embed url="<https://store.scriptsfivem.com/package/5834252>" %}

### Not required but recommended:

{% embed url="<https://github.com/overextended/ox_inventory>" %}
pre-configured for ox\_inventory in client\_editable.lua/server\_editable.lua
{% endembed %}

## 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 sfmechanic
```

## Step 3 ➡ Database

Run query/SQL query and paste below code.

{% code fullWidth="false" %}

```sql
CREATE TABLE `jobs_mechanic_projects` (
  `id` int(11) NOT NULL,
  `playerid` varchar(64) NOT NULL,
  `model` varchar(64) NOT NULL,
  `model_name` varchar(64) NOT NULL,
  `code` varchar(16) NOT NULL,
  `name` varchar(32) NOT NULL,
  `parts` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `jobs_mechanic_projects` ADD PRIMARY KEY (`id`);
ALTER TABLE `jobs_mechanic_projects` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
```

{% endcode %}

In the case of the ESX framework. For another framework, modify the query according to the name of the table and columns.

If you don't have a `price` column in the `vehicles` table

{% code fullWidth="false" %}

```sql
ALTER TABLE `vehicles` ADD `price` INT(11) NULL DEFAULT NULL AFTER `model`;
```

{% endcode %}

If you don't have a `class` column in the `vehicles` table

{% code fullWidth="false" %}

```sql
ALTER TABLE `vehicles` ADD `class` VARCHAR(2) NULL DEFAULT NULL AFTER `category`;
```

{% endcode %}

For nitrous system:\
❗`if you have another table that stores vehicles change owned_vehicles to your table`

{% code fullWidth="false" %}

```sql
ALTER TABLE `owned_vehicles` ADD `forgedEngine` INT(2) NOT NULL DEFAULT '0', ADD `nitrousEnabled` INT(2) NOT NULL DEFAULT '0', ADD `nitrousValue` FLOAT(11) NOT NULL DEFAULT '0';
```

{% endcode %}

{% hint style="warning" %}
Remember to use exports that will save the current nitro state or assign the state to the vehicle. \
`Exports are available in the client_editable.lua and server_editable.lua files.`
{% endhint %}

## Step 4 ➡ Click on [Config](/resources/sfmechanic/config)


# Config

## file config.lua

Select framework, language, notifications, banking and inventory system .

You can also fully configure menu tuning and its prices.<br>

if your language is unavailable in the list, you can make your own translation.

## file config.js

Select language. if your language is unavailable in the list, you can make your own translation.\
\
You can also hide prices for non-mechanics.


# Exports/Triggers

## TRIGGERS Lua code examples for Client Side

```lua
local result = exports["sfmechanic"]:statusMenu()
return result -- return true(if menu is open) or false
```

```lua
TriggerEvent("nuifix") -- if the NUI breaks.
```


# sfjail


# 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>" %}

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

### Pre-configured for ox\_target in client\_editable.lua, you can change it.

## 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 sfjail
```

## Step 3 ➡ Database

Run query/SQL query and paste below code.

{% code fullWidth="false" %}

```sql
-- for ESX
ALTER TABLE `users` ADD `jail_time` INT(5) NOT NULL DEFAULT 0;

-- for QB-Core
ALTER TABLE `players` ADD `jail_time` INT(5) NOT NULL DEFAULT 0;

-- for Other Framework
ALTER TABLE `yourTableWithUsers` ADD `jail_time` INT(5) NOT NULL DEFAULT 0;

```

{% endcode %}

## Step 4 ➡ Click on [Config](/resources/sfjail/config)


# Config

## file config.lua

Select framework, language, notifications system.

if your language is unavailable in the list, you can make your own translation.

You can also configure blip, polyzone, ped, cell coordinates, dishwashing work.


# Exports

## EXPORTS Lua code examples for Server Side

```lua
local source = 1
local time = 20
local result = exports["sfjail"]:sendToJail(source, time)
print(result) -- return true or false
```


# sfkeys


# Exports

## EXPORTS Lua code examples for Server Side

<pre class="language-lua"><code class="lang-lua"><strong>local source = source
</strong>local plate = "ABCDEFGH"
exports.sfkeys:addKeys(source, plate)
</code></pre>

<pre class="language-lua"><code class="lang-lua"><strong>local source = source
</strong>local plate = "ABCDEFGH"
exports.sfkeys:removeKeys(source, plate)
</code></pre>


# sfracingtablet


# 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>" %}

{% embed url="<https://github.com/mkafrin/PolyZone>" %}

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

## 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 sfracingtablet
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

{% code fullWidth="false" %}

```sql
CREATE TABLE `sfracingtablet_history` (
  `id` int(11) NOT NULL,
  `name` varchar(256) NOT NULL,
  `type` varchar(8) NOT NULL,
  `checkpointsCount` int(3) NOT NULL,
  `creator` varchar(64) NOT NULL,
  `timeStart` int(16) NOT NULL,
  `timeEnd` int(16) NOT NULL,
  `raceId` varchar(8) NOT NULL,
  `laps` int(3) NOT NULL,
  `classes` text NOT NULL,
  `ghosting` int(3) NOT NULL,
  `racers` longtext NOT NULL,
  `timestampStart` int(16) NOT NULL,
  `isTournament` int(2) NOT NULL,
  `moneyTournament` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


CREATE TABLE `sfracingtablet_players` (
  `id` int(11) NOT NULL,
  `identifier` varchar(46) DEFAULT NULL,
  `customName` varchar(64) NOT NULL,
  `avatar` text DEFAULT NULL,
  `points` int(11) NOT NULL DEFAULT 500,
  `winTournaments` int(11) NOT NULL DEFAULT 0,
  `winRaces` int(11) NOT NULL DEFAULT 0,
  `finishRaces` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `sfracingtablet_tracks` (
  `id` int(11) NOT NULL,
  `name` varchar(256) NOT NULL,
  `description` varchar(1024) NOT NULL,
  `type` varchar(8) NOT NULL,
  `checkpoints` longtext NOT NULL,
  `creatorid` varchar(64) NOT NULL,
  `creatorname` varchar(128) NOT NULL,
  `raceid` varchar(8) NOT NULL,
  `records` longtext NOT NULL,
  `verified` int(2) NOT NULL DEFAULT 0,
  `finished` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `sfracingtablet_history` ADD PRIMARY KEY (`id`);
ALTER TABLE `sfracingtablet_players` ADD PRIMARY KEY (`id`);
ALTER TABLE `sfracingtablet_tracks` ADD PRIMARY KEY (`id`);

ALTER TABLE `sfracingtablet_history` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `sfracingtablet_players` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `sfracingtablet_tracks` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
```

{% endcode %}

## Step 4 ➡ Click on [Config](/resources/sfracingtablet/config)&#x20;


# Config

## file config.lua

Select framework, language, inventory and notification system.

if your language is unavailable in the list, you can make your own translation.

## file config.js

Only select language and change or add your own vehicle classes.

if your language is unavailable in the list, you can make your own translation.


# Exports

## Lua code examples for Client Side

```lua
local isInRace = exports.sfracingtablet:checkIsInRace()
print(isInRace) -- return nil or raceId
```

```lua
local isInEditor = exports.sfracingtablet:checkIsInEditor()
print(isInEditor) -- return true or false
```


