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

  • generic_texture_renderer_gfx: Download

  • QBcore/ESX (Job checks)

  • Qb-target/Ox-target (for target)

Installation Guide

  1. Download generic_texture_renderer_gfx Download

  2. unzip the file into your resource folder

  3. ensure generic_texture_renderer_gfx in your server.cfg

  4. Download the script from your Keymaster

  5. Unzip the file a5-projector.zip and place it in your resource folder

  6. In your server.cfg do ensure a5-projector

  7. Restart your server

Configure Your Resource

QBCore

To use this resource with QBCore Framework. Go to Shared/sh_config.lua and set the framework to qb

Shared/sh_config.lua
Shared.Framework = 'qb' -- ['qb'] ['esx'] ['custom']

If you are using Old QBCore without the export. You can enable the option

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 server/sv_projector.lua and client/cl_projector.lua and editing the function

server/sv_projector.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 Shared/sh_config.lua and set the framework to esx

Shared/sh_config.lua
Shared.Framework = 'esx' -- ['qb'] ['esx'] ['custom']

If you are using Old ESX without the export. You can enable the option

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 server/sv_projector.lua and client/cl_projector.lua and editing the function

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)

Standalone

You an run this script as standalone. Just change the commands to fit your server custom framework. You can find the commands in server/sv_projector.lua

Adding new screens

The script utalizes props to hook the screen into. You can add the projector to any prop that has a good surface. You can add more screen through Shared/sh_config.lua

Shared/sh_config.lua
Shared.Screens = { -- do not mess with these values unless you know what you are doing
    {
        ['Object'] = 'your_prop',
        ['Scale'] = 0.07, --the scale of the screen
        ['Offset'] = vec3(-1.25, -0.01, 0.8), --offset from the object
        ['Distance'] = 7.5 * 1.75, -- the distance which people can see the projector
    },

}

Extra Functions

These functions are used for customization. In case you needed to trigger something when a certain event is trigger. You can find them in client/cl_projector.lua

client/cl_projector.lua
---when player sends click to projector
---@param state number | 0: forward 1: backward
function OnClickSend(state)

end

---when a player destroys the projector
function OnProjectorDestory()

end

---comment
---@param url string | the url which is used
---@param object string | name of the object used on
function OnSlideStart(url, object)

end

Last updated