Installation and Config
Here you will get your installation guide for the script and how to configure it as per your server.
Dependencies
generic_texture_renderer_gfx: Download
QBcore/ESX (Job checks)
Qb-target/Ox-target (for target)
Installation Guide
Download generic_texture_renderer_gfx Download
unzip the file into your resource folder
ensure generic_texture_renderer_gfx in your server.cfg
Download the script from your Keymaster
Unzip the file
a5-projector.zip
and place it in your resource folderIn your
server.cfg
do ensurea5-projector
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.Framework = 'qb' -- ['qb'] ['esx'] ['custom']
If you are using Old QBCore without the export. You can enable the option
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
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.Framework = 'esx' -- ['qb'] ['esx'] ['custom']
If you are using Old ESX without the export. You can enable the option
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
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.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
---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