Page cover image

Installation and Config

Here you will get your installation guide for the script and how to configure it as per your server.

Buy Script

CFX Post

Youtube Preview

Dependencies

ScreenshotBasic: Download

Installation Guide

  1. Download the script from your Keymaster

  2. Unzip the file a5-policecams.zip and place it in your resource folder

  3. In your server.cfg do ensure a5-policecams

  4. Restart 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

a5-policecams/Shared/sh_config.lua
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

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

a5-policehub/server/sv_main.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
        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

a5-policecams/Shared/sh_config.lua
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

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

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)

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

a5-policecams/Shared/sh_config.lua
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-Webhooks

Adding 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

a5-policecams/Shared/sh_config.lua

['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

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
end

Locale

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

a5-policecams/Shared/sh_lang.lua
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