# Installation

This script is designed to work seamlessly with <mark style="color:blue;">**ESX**</mark> and <mark style="color:red;">**QBCore/QBOX**</mark> frameworks.\
The configuration is the same for all frameworks and requires no additional steps.

***

## Install Dependencies

<table><thead><tr><th width="367">Resource</th><th>Download</th></tr></thead><tbody><tr><td>ox_lib</td><td><a href="https://github.com/overextended/ox_lib/releases">Download</a></td></tr></tbody></table>

## Insert SQL (<mark style="color:red;">ONLY ESX</mark>)

You can use the `insert.sql` file included in the script or copy its contents and execute them to set it up in your database.

```sql
CREATE TABLE `bz_zombiesystem` (
	`identifier` VARCHAR(255) NOT NULL COLLATE 'utf8_general_ci',
	`coins` INT(11) NULL DEFAULT '0',
	`level` INT(11) NULL DEFAULT '0',
	PRIMARY KEY (`identifier`) USING BTREE
) COLLATE='utf8_general_ci';
```

## OX Inventory

Go to `ox_inventory > modules > utils > client.lua` and locate the `Utils.WeaponWheel` function.

Underneath that function, add the following code:

```lua
-- Added
local Zombie = GetResourceState("bz_zombie") == "started" and exports["bz_zombie"]:inZombie() or false
if Zombie then
  state = true
end

--All Function
function Utils.WeaponWheel(state)
    if client.disableweapons then state = true end
    if state == nil then state = EnableWeaponWheel end
	
	local Zombie = GetResourceState("bz_zombie") == "started" and exports["bz_zombie"]:inZombie() or false
	if Zombie then
        state = true
    end

    EnableWeaponWheel = state
    SetWeaponsNoAutoswap(not state)
    SetWeaponsNoAutoreload(not state)

    if client.suppresspickups then
        -- CLEAR_PICKUP_REWARD_TYPE_SUPPRESSION | SUPPRESS_PICKUP_REWARD_TYPE
        return state and N_0x762db2d380b48d04(rewardTypes) or N_0xf92099527db8e2a7(rewardTypes, true)
    end
end
```

## Revive Event

```lua
Config.Revive = function(ped)
	if GetResourceState("qb-ambulancejob") == "started" then
		TriggerEvent("hospital:client:Revive")
	elseif GetResourceState("esx_ambulancejob") == "started" then
		TriggerEvent("esx_ambulancejob:revive")
	end
end
```

## Inventory Image

```lua
Config.ItemImage = function(item)
	if GetResourceState("ox_inventory") == "started" then
		return "nui://ox_inventory/web/images/"..item..".png"
	elseif GetResourceState("qb-inventory") == "started" then
		return "nui://qb-inventory/html/images/"..item..".png"
	elseif GetResourceState("bb_inventory") == "started" then
		return "nui://bb_inventory/html/images/"..item..".png"
	end
end
```

## Logs (server/logs.lua)

<pre class="language-lua"><code class="lang-lua"><strong>Webhooks = {
</strong>	["addcoin"] = "",
	["buyproduct"] = "",
}

function Logger(name, title, message)
	if not Webhooks[name] then return end
	local webHook = Webhooks[name] ~= '' and Webhooks[name] or false

	if not webHook then return end
	
	local embedData = {
		{
			['title'] = title,
			['color'] = 65280,
			['footer'] = {
				['text'] = os.date('%c'),
			},
			['description'] = message,
			['author'] = {
				['name'] = GetCurrentResourceName(),
				['icon_url'] = 'https://i.imgur.com/fitctCs.png',
			}
		}
	}

	logsData = { username = 'BZ Logs', embeds = embedData }
	PerformHttpRequest(webHook, function() end, 'POST', json.encode(logsData), { ['Content-Type'] = 'application/json' })
end
</code></pre>


---

# Agent Instructions: 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://bbstore.gitbook.io/docs/resources/bb-zombie/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.
