> For the complete documentation index, see [llms.txt](https://docs.scriptsfivem.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scriptsfivem.com/resources/sfems/installations.md).

# 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.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.scriptsfivem.com/resources/sfems/installations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
