Installation

Guide to install the HighQez AFK Safe Zone

Download Resource

Make sure you purchase the script using the same Keymaster Account 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

If you are using FTP, please ensure you use WinSCP to transfer the resource to the server. If you use FileZilla, you may encounter the error "Failed to verify protected resource"


Resource Dependency

Name
Download Link

Start Resource

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

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

Config File
config.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,
			},
		},
	},

}


Resource API

Check out the API page to access all APIs for this resource, which can be very useful for developers

API

Last updated

Was this helpful?