client/no_escrow.lua
-- | # Notification System ------------------------------------------------------------------------------------
-- | You can easily customize this function according to your own notification script.
Notification = function(Title, Message, Type)
lib.notify({
title = Title,
description = Message,
type = Type
})
end
-- | # Custom Safezone Enter Event ------------------------------------------------------------------------------------
-- | This function is triggered when a player enters a safezone.
On_Enter_Safezone = function()
-- | You can add your own custom logic here (e.g., custom notifications, logging, etc.)
end
-- | # Custom Safezone Exit Event ------------------------------------------------------------------------------------
-- | This function is triggered when a player exits a safezone.
On_Exit_Safezone = function()
-- | You can add your own custom logic here (e.g., custom notifications, logging, etc.)
end
-- | # Job Bypass System ------------------------------------------------------------------------------------
-- | These codes will be activated if you are using the job bypass system.
-- | If necessary, you can customize them according to your framework.
Framework_Object = nil
Load_Framework = function()
if not Config.Job_Bypass['Enabled'] then return end
local framework = Config.Job_Bypass['Framework']
if framework == 'esx' then
Framework_Object = exports['es_extended']:getSharedObject()
elseif framework == 'old-esx' then
Framework_Object = nil
TriggerEvent('esx:getSharedObject', function(obj) Framework_Object = obj end)
elseif framework == 'qb' then
Framework_Object = exports['qb-core']:GetCoreObject()
elseif framework == 'old-qb' then
Framework_Object = nil
Citizen.CreateThread(function()
while Framework_Object == nil do
TriggerEvent('QBCore:GetObject', function(obj) Framework_Object = obj end)
Citizen.Wait(200)
end
end)
elseif framework == 'qbox' then
if GetResourceState("qbx_core") == "started" then
Framework_Object = exports['qbx-core']:GetCoreObject()
elseif GetResourceState("qbx-core") == "started" then
Framework_Object = exports['qbx_core']:GetCoreObject()
end
end
end
Get_Player_Job = function()
if not Config.Job_Bypass['Enabled'] then return nil end
if not Framework_Object then return nil end
local framework = Config.Job_Bypass['Framework']
if framework == 'esx' or framework == 'old-esx' then
local playerData = Framework_Object.GetPlayerData()
return playerData.job and playerData.job.name or nil
elseif framework == 'qb' or framework == 'old-qb' then
local playerData = Framework_Object.Functions.GetPlayerData()
return playerData.job and playerData.job.name or nil
elseif framework == 'qbox' then
local playerData = exports.qbx_core:GetPlayerData()
return playerData.job and playerData.job.name or nil
end
return nil
end
-- | # Load Script ------------------------------------------------------------------------------------
-- | When the script starts, load framework (if enabled) and safezones
Citizen.CreateThread(function()
if Config.Job_Bypass['Enabled'] then
Load_Framework()
end
Load_Safezones()
end)Last updated