> For the complete documentation index, see [llms.txt](https://docs.biyei.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.biyei.net/scripts/arenas-pvp/installation.md).

# Installation

### **•** STEP 1: DEPENDENCIES

Make sure you have this resources installed in your server!

1. <mark style="color:yellow;">ESX</mark> or <mark style="color:purple;">QB-CORE</mark>
2. [Biyei Utils](https://github.com/biyeicito/biyei_utils)

### **• STEP 2: START ORDER**

```
ensure biyei_utils
ensure biyei_arenas
```

{% hint style="warning" %}
Don't rename resource or you will get error (credits).
{% endhint %}

### **• STEP 3: FOR OX\_INVENTORY**

{% hint style="info" %}
If you don't have ox\_inventory ignore this step
{% endhint %}

Add this line in the server.cfg

```
setr inventory:weaponmismatch false
```

### **• STEP 4: INSTALL SQL**

{% hint style="info" %}
Important install SQL
{% endhint %}

```sql
CREATE TABLE IF NOT EXISTS `biyei_arenas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `player` varchar(150) DEFAULT NULL,
  `username` varchar(150) DEFAULT NULL,
  `deaths` int(11) DEFAULT 0,
  `kills` int(11) DEFAULT 0,
  `score` int(11) DEFAULT 0,
  `wins` int(11) DEFAULT 0,
  `losses` int(11) DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `Columna 2` (`player`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE IF NOT EXISTS `biyei_arenas_players` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `player` varchar(150) NOT NULL DEFAULT '0',
  `status` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `player` (`player`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
```

### **• STEP 5: FOR ESX\_AMBULANCE REVIVE FUNCTION (ONLY ESX)**

```lua
RegisterNetEvent('esx_ambulancejob:revive')
AddEventHandler('esx_ambulancejob:revive', function()
  local playerPed = PlayerPedId()
  local coords = GetEntityCoords(playerPed)

  TriggerServerEvent('esx_ambulancejob:setDeathStatus', false)

 
  local inMatchGame = LocalPlayer.state.InMatch or LocalPlayer.state.InRankedMatch

  
  if not inMatchGame then
    DoScreenFadeOut(800)
    while not IsScreenFadedOut() do
      Wait(50)
    end
  end

  


  local formattedCoords = {x = ESX.Math.Round(coords.x, 1), y = ESX.Math.Round(coords.y, 1), z = ESX.Math.Round(coords.z, 1)}

  RespawnPed(playerPed, formattedCoords, 0.0)
  isDead = false
  ClearTimecycleModifier()
  SetPedMotionBlur(playerPed, false)
  ClearExtraTimecycleModifier()
  EndDeathCam() 
  DoScreenFadeIn(800)
end)

```

```lua
function RespawnPed(ped, coords, heading)
  local inMatchGame = LocalPlayer.state.InMatch or LocalPlayer.state.InRankedMatch

  SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false)
  if not inMatchGame then
    NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
  end
  SetPlayerInvincible(ped, false)
  ClearPedBloodDamage(ped)

  if Config.DeathAnim.enabled then
    FreezeEntityPosition(ped, false)
  end

  TriggerEvent('esx_basicneeds:resetStatus')
  TriggerServerEvent('esx:onPlayerSpawn')
  TriggerEvent('esx:onPlayerSpawn')
  TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon
end

```

### **• STEP 6: Add function InMatch in your inventory**

For ox\_inventory or another inventory disable open in match

```lua
-- Open Inventory
-- ox_inventory/client.lua
local function canOpenInventory()
   if exports.biyei_arenas:InMatch() or exports.biyei_arenas:InRankedMatch() then
     return shared.info('cannot open inventory', '(in match)')
   end
   return true
end


--- Use Item
local function canUseItem(isAmmo)
   local ped = cache.ped
   if exports.biyei_arenas:InMatch() or exports.biyei_arenas:InRankedMatch() then
      return shared.info('cannot open inventory', '(in match)')
   end
end
```


---

# 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:

```
GET https://docs.biyei.net/scripts/arenas-pvp/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
