---
description: Guide to install the HighQez AFK Safe Zone
---

# Installation

## Download Resource

{% hint style="success" %}
Purchase the script from our [HighQez Store](https://highqez.tebex.io/). After the purchase, the resource will be available in your [Keymaster Account](https://keymaster.fivem.net/asset-grants)
{% endhint %}

Make sure you purchase the script using the same [Keymaster Account](https://keymaster.fivem.net/) that is linked to your server. If not you will receive a warning "**You lack the required entitlement".**

If you receive the error mentioned above, you may have to transfer the resource from the current Keymaster account to the server's Keymaster account using the transfer feature in Keymaster.

***

## Transfer Resource

{% hint style="success" %}
Unzip the downloaded file and transfer it to your server's resource folder
{% endhint %}

If you are using **FTP**, please ensure you use [**WinSCP** ](https://winscp.net/eng/download.php)to transfer the resource to the server. If you use FileZilla, you may encounter the error "**Failed to verify protected resource**"

***

## Resource Dependency

{% hint style="success" %}
Make sure you have installed and started the below resources on your server
{% endhint %}

| Name       | Download Link                                                              |
| ---------- | -------------------------------------------------------------------------- |
| _PolyZone_ | [https://github.com/mkafrin/PolyZone](https://github.com/mkafrin/PolyZone) |

***

## Start Resource

{% hint style="success" %}
Ensure the resource in server.cfg of your server
{% endhint %}

Make sure to start the resource only after all essential server resources have been started. Follow the example below to **ensure highqez\_AFKzone**

```
ensure es_extended/qb-core #Don't start above this
ensure PolyZone #Don't start above this

#Start the HighQez resource here

ensure highqez_AFKzone

#Start the rest of your resources
```

***

## Configure Resource

{% hint style="success" %}
Customize the script to suit the specific requirements of your server
{% endhint %}

Open-source files are available for editing the framework function. The main configuration of the resource is provided below

<details>

<summary>Config File</summary>

{% code title="config.lua" %}
```lua
Config = {}

Config.Timelimit = 1200 -- AFK kick TIMER within time in seconds

Config.OxInventory = false --True if you are using the ox_inventory, if not then false

Config.AdminRoles = {'mod', 'admin', 'superadmin', 'god'} --Disable AFK kick for admins, staying AFK outside the AFK Zone

Config.ZoneProperty = {
    ['hospitalzone'] = { --Zone name can be same in the Config.RadiusZone & Config.PolyZone
        PauseFood = true, 
        PauseWater = true, 
        ReduceStress = true, --Stress script is not included in this script. Change the event in cl_function.lua 
        EnableSafeZoneUI = true,
        EnableAFKZoneUI = true,
        GodMode = true,
        DisableWeapon = true,
        Speedlimit = 'mph', --'mph', 'kmh' or false
        StressRelief = 0.5, --if ReduceStress = true, Amount of Stress relief per second
        SpeedlimitValue = 30,
        WhitelistJobs = {'ambulance', 'police'} --Jobs to bypass the safezone restriction
    },
    ['policestationzone'] = { --Zone name can be same in the Config.RadiusZone & Config.PolyZone
        PauseFood = true, 
        PauseWater = true, 
        ReduceStress = true, --Stress script is not included in this script. Change the event in cl_function.lua
        EnableSafeZoneUI = true,
        EnableAFKZoneUI = true,
        GodMode = true,
        DisableWeapon = true,
        Speedlimit = 'mph', --'mph', 'kmh' or false
        StressRelief = 0.5, --if ReduceStress = true, Amount of Stress relief per second
        SpeedlimitValue = 30,
        WhitelistJobs = {'ambulance', 'police'} --Jobs to bypass the safezone restriction
    },
}

Config.RadiusZone = {
    ['hospitalzone'] = { --Zone name should be from the Config.ZoneProperty Name
        x = 328.9448, y = -587.4816, z = 71.2261, radius = 100.0
    },
}

Config.PolyZone = {
    ['policestationzone'] = { --Zone name should be from the Config.ZoneProperty Name
		Debug = false,
		Zones = {
		    {
			    Coords = {
                    vector2(407.26150512695, -961.58459472656),
                    vector2(493.48638916016, -960.46148681641),
                    vector2(494.44357299805, -1026.5689697266),
                    vector2(405.16998291016, -1032.1352539062)
				},
                minZ = 28.375925064087,
				maxZ = 30.246887207031,
			},
		},
	},

}
```
{% endcode %}



</details>

***

## Resource API

{% hint style="info" %}
Check out the API page to access all APIs for this resource, which can be very useful for **developers**
{% endhint %}

{% content-ref url="api" %}
[api](api)
{% endcontent-ref %}

***
