Unzip the file a5-policehub.zip and place it in your resource folder
In your server.cfg do ensure a5-policehub
Restart your server
Configure Your Resource
QBCore
To use this resource with QBCore Framework. Go to a5-policehub/Shared/sh_config.lua and set the framework to qb
a5-policehub/Shared/sh_config.lua
Shared.Framework = 'qb' -- 'qb' 'esx'
If you are using Old QBCore without the export. You can enable the option in a5-policehub/Shared/sh_config.lua
a5-policehub/Shared/sh_config.lua
Shared.UseOldQB = false -- if you want to use old method of calling core and not the export
Shared.OldQbTrigger = "QBCore:GetObject"
You can also edit the getcoreobject function if you renamed your core by going to a5-policehub/server/sv_hub.lua and a5-policehub/client/cl_hub.lua and editing the function
a5-policehub/server/sv_hub.lua
CreateThread(function()
if Shared.Framework == "qb" then
if Shared.UseOldQB then
TriggerEvent(Shared.OldQbTrigger, function(obj) QBCore = obj end)
else
QBCore = exports['qb-core']:GetCoreObject()
end
Debug("Loaded QBCore Policehub")
elseif Shared.Framework == "esx" then
if Shared.UseOldESX then
TriggerEvent(Shared.OldESXTrigger, function(obj) ESX = obj end)
else
ESX = exports['es_extended']:getSharedObject()
end
Debug("Loaded ESX Policehub")
else
print("Framework Not Supported")
end
end)
ESX
To use this resource with QBCore Framework. Go to a5-policehub/Shared/sh_config.lua and set the framework to esx
a5-policehub/Shared/sh_config.lua
Shared.Framework = 'esx' -- 'qb' 'esx'
If you are using Old ESX without the export. You can enable the option in a5-policehub/Shared/sh_config.lua
a5-policehub/Shared/sh_config.lua
Shared.UseOldESX = false -- if you want to use old method of calling core and not the export
Shared.OldESXTrigger = "esx:getSharedObject"
You can also edit the getcoreobject function if you renamed your core by going to a5-policehub/server/sv_hub.lua and a5-policehub/client/cl_hub.lua and editing the function
a5-policehub/server/sv_hub.lua
CreateThread(function()
if Shared.Framework == "qb" then
if Shared.UseOldQB then
TriggerEvent(Shared.OldQbTrigger, function(obj) QBCore = obj end)
else
QBCore = exports['qb-core']:GetCoreObject()
end
Debug("Loaded QBCore Policehub")
elseif Shared.Framework == "esx" then
if Shared.UseOldESX then
TriggerEvent(Shared.OldESXTrigger, function(obj) ESX = obj end)
else
ESX = exports['es_extended']:getSharedObject()
end
Debug("Loaded ESX Policehub")
else
print("Framework Not Supported")
end
end)
UI Customisation
You can customise certain elements of the UI through a5-policehub/Shared/sh_config.js
a5-policehub/Shared/sh_config.js
Shared.Access = {
// If false the quick bar on the top left will not show
'Quickbar': true,
// If false this will hide change status button on quick bar
'Dutyaccess': true,
// If false this will hide the listing option button on quick bar
'Listingoptions': true,
}
Shared.Settings = {
// The default amount of space the ui will have from the top to the bottom
'top': "10%",
// The default amount of space the ui will have from the left to the right
'left': "84%",
// The default height of the ui
'height': "42%",
// The default width of the ui
'width': "14%",
// the list background color
'background': 'rgba(20,20,20,0.0)',
// Header text
'name': "A5 Police Hub",
}
Locale
You can change some certain Script locales by heading to a5-policehub/Shared/sh_lang.lua Additionally you can edit UI locale through the HTML file
a5-policehub/Shared/sh_lang.lua
Lang.OnDuty = "You are now in Service!"
Lang.OffDuty = "You are now out of service!"
Lang.WayPoint = "Waypoint set to"
Lang.RadioConnect = "connected to Radio"
Lang.NoAccess = "No Access to this"
Extra Information
You can click and drag the phub to change the position of it
You can drag and use mousewheel to change the opacity
You can scale the phub by clicking the bottom right corner
You can trigger phub from things like Radial Menu by using the following Client trigger "a5-policehub:client:openHub" but make sure you put a police check as it only exists in the command