Installation and Config
Here you will get your installation guide for the script and how to configure it as per your server.
Dependencies
ScreenshotBasic: Download
Installation Guide
Download the script from your Keymaster
Unzip the file
a5-policecams.zipand place it in your resource folderIn your
server.cfgdo ensurea5-policecamsRestart your server
Configure Your Resource
QBCore
To use this resource with QBCore Framework. Go to a5-policecams/Shared/sh_config.lua and set the framework to qb
Shared.Framework = 'qb' -- ['qb'] ['esx'] ['custom']If you are using Old QBCore without the export. You can enable the option in a5-policecams/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-policecams/server/sv_main.lua and a5-policecams/client/cl_cams.lua and editing the function
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
print("Loaded QBCore Policecams")
elseif Shared.Framework == "esx" then
if Shared.UseOldESX then
TriggerEvent(Shared.OldESXTrigger, function(obj) ESX = obj end)
else
ESX = exports['es_extended']:getSharedObject()
end
print("Loaded ESX PoliceCams")
else
print("Framework Not Supported")
end
end)
ESX
To use this resource with ESX Framework. Go to a5-policecams/Shared/sh_config.lua and set the framework to esx
Shared.Framework = 'esx' -- ['qb'] ['esx'] ['custom']If you are using Old ESX without the export. You can enable the option in a5-policecams/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-policecams/server/sv_main.lua and a5-policecams/client/cl_cams.lua and editing the function
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)Image Saving
The script uses Discrod webhook to upload images. You can setup your webhook in the following file a5-policecams/Shared/sh_config.lua by creating a discord webhook. To learn how to create a discord webhook visit this link
Shared.DiscordWebHook = "YOUR-WEBHOOK-HERE" -- Put your webhook here to save screenshots to discord https://support.discord.com/hc/en-us/articles/228383668-Intro-to-WebhooksAdding Cameras
If you want to add cameras. You can create your own custom category and it will show directly on the UI. This is the format you should use
['custom'] = { -- the name of the category
MarkerColor = 'rgb(240, 22, 120)', -- category color to show in UI
MarkerIcon = 'fa-solid fa-building-columns', -- The icon used to show on UI https://forums.gta5-mods.com/topic/12424/reference-timecycle-modifier-setting-names
CamType = 'secret_camera', -- camera effect type
CamStrength = '0.96', --the strength of the effect
CarSpeedIndecator = false, -- if the camera should have car speed indicator
CameraMovement = true, --if camera can move using WASD
coords = {
[0] = {
[0] = {location = nil, x = 433.25845336914, y = -978.44812011719, z = 33.743709564209, h = 116.2878036499, IsDisabled = false}, --0 index should always have location = nil
[1] = {x = 424.03778076172, y = -996.80932617188, z = 34.468765258789, h = 113.70291137695, IsDisabled = false},
[2] = {x = 427.49160766602, y = -1012.0303344727, z = 34.171649932861, h = 111.28598022461, IsDisabled = false},
[3] = {x = 438.60894775391, y = -999.51812744141, z = 33.068157196045, h = 208.72505187988, IsDisabled = false},
[4] = {x = 466.30383300781, y = -1016.0286865234, z = 35.468776702881, h = 228.79200744629, IsDisabled = false},
[5] = {x = 494.36407470703, y = -967.91625976563, z = 35.67956161499, h = 96.381248474121, IsDisabled = false},
},
}
},Extra Functions
These functions are used for customization. In case you needed to trigger something when a certain UI element is triggered. You can find them in a5-policecams/client/cl_cams.lua
function OpenUI()
-- gets triggered when you open the first UI
end
function CloseUI()
-- gets triggered when you close the UI
end
function OpenCamera()
-- gets triggered when you open or change camera
end
function CloseCamera()
-- gets triggered when you close the cam
end
---This function triggers when you scan a vehicle plate
---@param plate string - vehicle plate
---@param speed integer - the speed
function ScanVehicle(plate, speed)
-- gets triggered when you scan a vehicle with ctrl+x
endLocale
You can change some certain Script locales by heading to a5-policecams/Shared/sh_lang.lua Additionally you can edit UI locale through the HTML file
Lang.PoliceOnly = "No Access to this"
Lang.NotNearStation = "Not Near Station"
Extra Information
W A S D to move the camera
CTRL+W To zoom in. CTRL+S to zoom out
CTRL+X to plate read
CTRL+C to take screenshot
You can use the following client event to open the cams
'a5-policecams:client:OpenCamMenu'
Last updated
