Skip to content
Merged
22 changes: 13 additions & 9 deletions Config.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
Config = {}
ps = {}

Config.Notify = "ox" -- qb, ox, ps, esx, mad_thoughts
Config.Menus = "ox" -- qb, ox, ps
Config.DrawText = "ox" -- qb, ox, ps
Config.Inventory = "auto" -- auto, ox_inventory, qb-inventory, ps-inventory, lj-inventory, tgiann-inventory, jpr-inventory
Config.Target = "auto" -- auto, ox_target, qb-target, interact
Config.EmoteMenu = "rpemotes" -- rpemotes, dpemotes, scully, anything else for custom
Config.Notify = "ox" -- qb, ox, ps, esx, mad_thoughts, okok, lation
Config.Menus = "ox" -- qb, ox, ps, lation
Config.DrawText = "ox" -- qb, ox, ps, lation, okok
Config.Banking = "qb" -- qb, okok, Renewed, none
Config.VehicleKeys = "qb" -- qb, mrnewb, none
Config.ConvertQBMenu = false -- Convert qb-menu to ps-ui context menu and qb-input to ps-ui input

Config.Progressbar = { -- these are DEFAULT values, you can override them in the progressbar function
style = "keep", -- qb, oxbar, oxcircle, keep
style = "oxcircle", -- qb, oxbar, oxcircle, keep
Movement = true, -- Disable movement
CarMovement = true, -- Disable car movement
Mouse = true, -- Disable mouse
Combat = true, -- Disable combat
}

Config.Logs = "fivemerr" -- fivemerr or fivemanage

Config.Logs = "fivemerr" -- fivemerr or fivemanage

QBCore, ESX, qbx, langs = nil, nil, nil

if GetResourceState('qbx_core') == 'started' then
qbx = exports.qbx_core
langs = GetConvar('ox:locale', 'en')
langs = GetConvar('ox:locale', 'en') or 'en'
elseif GetResourceState('es_extended') == 'started' then
ESX = exports['es_extended']:getSharedObject()
langs = GetConvar('esx:locale', 'en')
langs = GetConvar('esx:locale', 'en') or 'en'
elseif GetResourceState('qb-core') == 'started' then
QBCore = exports['qb-core']:GetCoreObject()
langs = GetConvar('qb_locale', 'en')
langs = GetConvar('qb_locale', 'en') or 'en'
end
35 changes: 35 additions & 0 deletions bridge/banking/Renewed/server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ps.success('Banking Module Loaded: Renewed Banking')
function ps.addAccountMoney(id, amount, reason)
if not id then
return false
end
if not amount or amount < 0 then
return false
end
exports['Renewed-Banking']:addAccountMoney(id, amount)
return true
end

function ps.removeAccountMoney(id, amount, reason)
if not id then
return false
end
if not amount or amount < 0 then
return false
end
if exports['Renewed-Banking']:removeAccountMoney(id, amount) then
return true
end
return false
end

function ps.getAccountMoney(id)
if not id then
return 0
end
local money = exports['Renewed-Banking']:getAccountMoney(id)
if money then
return money
end
return 0
end
35 changes: 35 additions & 0 deletions bridge/banking/okok/server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ps.success('Banking Module Loaded: OKOK Banking')
function ps.addAccountMoney(id, amount, reason)
if not id then
return false
end
if not amount or amount < 0 then
return false
end
exports['okokBanking']:AddMoney(id, amount)
return true
end

function ps.removeAccountMoney(id, amount, reason)
if not id then
return false
end
if not amount or amount < 0 then
return false
end
if exports['okokBanking']:RemoveMoney(id, amount) then
return true
end
return false
end

function ps.getAccountMoney(id)
if not id then
return 0
end
local money = exports['okokBanking']:GetAccount(id)
if money then
return money
end
return 0
end
41 changes: 41 additions & 0 deletions bridge/banking/qb/server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ps.success('Banking Module Loaded: QB-Banking')
function ps.addAccountMoney(id, amount, reason)
if not id then
return false
end
if not amount or amount < 0 then
return false
end
if not reason then
reason = ""
end
exports['qb-banking']:AddMoney(id, amount, reason)
return true
end

function ps.removeAccountMoney(id, amount, reason)
if not id then
return false
end
if not amount or amount < 0 then
return false
end
if not reason then
reason = ""
end
if exports['qb-banking']:RemoveMoney(id, amount, reason) then
return true
end
return false
end

function ps.getAccountMoney(id)
if not id then
return 0
end
local money = exports['qb-banking']:GetBalance(id)
if money then
return money
end
return 0
end
117 changes: 48 additions & 69 deletions bridge/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ local emote, framework, inventory, target = false, false, false, false
-- Emote Loading
local emoteResources = {
['rpemotes'] = 'bridge/emote/rp/client.lua',
['rpemotes-reborn'] = 'bridge/emote/rp/client.lua',
['dpemotes'] = 'bridge/emote/dp/client.lua',
['scully_emotemenu'] = 'bridge/emote/scully/client.lua',
['scully'] = 'bridge/emote/scully/client.lua',
}

local frameworkResources = {
Expand All @@ -19,6 +18,7 @@ local inventoryResources = {
['lj-inventory'] = 'bridge/inventory/lj/client/lj.lua',
['ps-inventory'] = 'bridge/inventory/ps/client/ps.lua',
['jpr-inventory'] = 'bridge/inventory/jpr/client/jpr.lua',
['tgiann-inventory'] = 'bridge/inventory/tgiann/client/tgg.lua',
}

local targetResources = {
Expand Down Expand Up @@ -59,42 +59,12 @@ local menus = {
['ps'] = 'ps.lua',
}

local vehicleKeys = {
['qb'] = 'bridge/vehiclekeys/qb/client/client.lua',
['mrnewb'] = 'bridge/vehiclekeys/mrnewb/client/client.lua',
}


local function loadEmotes()
for script, path in pairs(emoteResources) do
if GetResourceState(script) == 'started' then
loadLib(path)
emote = true
ps.success(('Emote resource found: %s'):format(script))
break
end
end

if not emote then
loadLib('bridge/emote/custom/client.lua')
ps.warn('No emote resource found: falling back to custom')
end
end

AddEventHandler('onResourceStart', function(resourceName)
if emoteResources[resourceName] then
loadLib(emoteResources[resourceName])
ps.success(('Emote resourcedfs started: %s'):format(resourceName))
emote = resourceName
end
end)

loadEmotes()

for k, v in pairs(zones) do
if GetResourceState(v.script) == 'started' then
loadLib(v.path)
ps.success(('Zone resource found: %s'):format(v.script))
break
end
end

local function loadFramework()
for key, v in ipairs(frameworkResources) do
if GetResourceState(v.name) == 'started' then
Expand All @@ -117,7 +87,6 @@ local function loadInventory()
if GetResourceState(script) == 'started' then
loadLib(path)
inventory = script
ps.success(('Inventory resource found: %s'):format(script))
break
end
end
Expand All @@ -128,49 +97,59 @@ local function loadInventory()
end
end

loadInventory()

AddEventHandler('onResourceStart', function(resourceName)
if inventoryResources[resourceName] then
loadLib(inventoryResources[resourceName])
ps.success(('Inventory resource started: %s'):format(resourceName))
end
end)

local function loadTarget()
for script, path in pairs(targetResources) do
if GetResourceState(script) == 'started' then
loadLib(path)
target = script
ps.success(('Target resource found: %s'):format(script))
return
end
end
end

loadTarget()
local function loadAll()
if Config.Inventory ~= 'auto' then
if inventoryResources[Config.Inventory] then
loadLib(inventoryResources[Config.Inventory])
else
loadLib('bridge/inventory/custom/client/custom.lua')
ps.warn('No inventory resource found: falling back to custom')
end
else
loadInventory()
end

AddEventHandler('onResourceStart', function(resourceName)
if targetResources[resourceName] then
loadLib(targetResources[resourceName])
ps.success(('Target resource started: %s'):format(resourceName))
if Config.Target ~= 'auto' then
if targetResources[Config.Target] then
loadLib(targetResources[Config.Target])
end
else
loadTarget()
end
end)

if menus[Config.Menus] then
loadLib('bridge/menus/'..menus[Config.Menus])
ps.success(('Menu system loaded: %s'):format(Config.Menus))
end
if menus[Config.Menus] then
loadLib('bridge/menus/'..menus[Config.Menus])
end

if drawText[Config.DrawText] then
loadLib('bridge/drawtext/'..drawText[Config.DrawText])
ps.success(('DrawText system loaded: %s'):format(Config.DrawText))
end
if notify[Config.Notify] then
loadLib('bridge/notify/'..notify[Config.Notify])
ps.success(('Notify system loaded: %s'):format(Config.Notify))
end
if progressbars[Config.Progressbar.style] then
loadLib('bridge/progressbars/'..progressbars[Config.Progressbar.style])
ps.success(('Progressbar system loaded: %s'):format(Config.Progressbar.style))
if drawText[Config.DrawText] then
loadLib('bridge/drawtext/'..drawText[Config.DrawText])
end
if notify[Config.Notify] then
loadLib('bridge/notify/'..notify[Config.Notify])
end
if progressbars[Config.Progressbar.style] then
loadLib('bridge/progressbars/'..progressbars[Config.Progressbar.style])
end
if vehicleKeys[Config.VehicleKeys] then
loadLib(vehicleKeys[Config.VehicleKeys])
end
if emoteResources[Config.EmoteMenu] then
loadLib(emoteResources[Config.EmoteMenu])
end
if GetResourceState('ox_lib') == 'started' then
loadLib('bridge/zones/ox/client.lua')
else
loadLib('bridge/zones/PolyZone/client.lua')
end
end

loadAll()
13 changes: 13 additions & 0 deletions bridge/drawtext/lation.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ps.success('Draw Text Module Loaded: Lation UI')

function ps.drawText(text)
if not text then return end
exports.lation_ui:showText(text)
end

function ps.hideText()
exports.lation_ui:hideText()
end

exports('drawText', ps.drawText)
exports('hideText', ps.hideText)
12 changes: 12 additions & 0 deletions bridge/drawtext/okok.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ps.success('Draw Text Module Loaded: Okok')

function ps.drawText(text)
if not text then return end
exports['okokTextUI']:Open(text, 'lightgrey', 'right', true)
end

function ps.hideText()
exports['okokTextUI']:Close()
end
exports('drawText', ps.drawText)
exports('hideText', ps.hideText)
7 changes: 6 additions & 1 deletion bridge/drawtext/ox.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
ps.success('Draw Text Module Loaded: ox_lib')

function ps.drawText(text)
if not text then return end
lib.showTextUI(text)
end

function ps.hideText()
lib.hideTextUI()
end
end

exports('drawText', ps.drawText)
exports('hideText', ps.hideText)
7 changes: 6 additions & 1 deletion bridge/drawtext/ps.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
ps.success('Draw Text Module Loaded: PS-UI')

function ps.drawText(text)
if not text then return end
exports['ps-ui']:drawText(text, "yellow")
end

function ps.hideText()
exports['ps-ui']:hideDrawText()
end
end

exports('drawText', ps.drawText)
exports('hideText', ps.hideText)
Loading