Merge pull request #3 from TheOrderFivem/main

sync
This commit is contained in:
Mr.Crowley authored and GitHub committed 2026-03-17 22:52:42 -05:00
commit 74afce7b99
15 files changed
+79 -15

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ use_experimental_fxv2_oal 'yes'
author 'The Order of the Sacred Framework' author 'The Order of the Sacred Framework'
name 'community_bridge' name 'community_bridge'
description 'A Universal Bridge for Our Community, created by a group of contributors with a shared vision to enhance both user and developer experiences. This bridge connects various frameworks, inventories, target systems, notification systems, and more, fostering compatibility and seamless integration.' description 'A Universal Bridge for Our Community, created by a group of contributors with a shared vision to enhance both user and developer experiences. This bridge connects various frameworks, inventories, target systems, notification systems, and more, fostering compatibility and seamless integration.'
version '0.13.2' version '0.13.3'
shared_scripts { shared_scripts {
'@ox_lib/init.lua', '@ox_lib/init.lua',
+1 -1
View File
@@ -114,7 +114,7 @@ function Marker.Run()
) )
::continue:: ::continue::
end end
Wait(3) Wait(2)
end end
end) end)
end end
+19
View File
@@ -78,6 +78,25 @@ Framework.GetPlayer = function(src)
return xPlayer return xPlayer
end end
---@description Returns the player data of the specified identifier in the framework defualt format.
---@param citizenid string
---@return table | nil
Framework.GetPlayerByIdentifier = function(citizenid)
local player = ESX.GetPlayerFromIdentifier(citizenid)
if not player then return end
return player
end
---@description This will return the player source of the specified citizen ID.
---@param citizenid string
---@return number | nil
Framework.GetPlayerSource = function(citizenid)
local player = Framework.GetPlayerByIdentifier(citizenid)
if not player then return end
return player.source
end
--- @description Returns the citizen ID of the player. --- @description Returns the citizen ID of the player.
--- @param src number --- @param src number
--- @return string | nil returns the citizen ID of the player if it exists --- @return string | nil returns the citizen ID of the player if it exists
+23 -1
View File
@@ -26,7 +26,10 @@ end
---@return boolean ---@return boolean
Framework.GetIsFrameworkAdmin = function(src) Framework.GetIsFrameworkAdmin = function(src)
if not src then return false end if not src then return false end
return QBCore.Functions.HasPermission(src, 'admin') local isAdmin = QBCore.Functions.HasPermission(src, 'admin')
local isGod = QBCore.Functions.HasPermission(src, 'god')
local isAceAllowed = IsPlayerAceAllowed(src, 'command')
return isAdmin or isGod or isAceAllowed
end end
---@description This will return the citizen ID of the player. ---@description This will return the citizen ID of the player.
@@ -48,6 +51,25 @@ Framework.GetPlayer = function(src)
return player return player
end end
---@description Returns the player data of the specified identifier in the framework defualt format.
---@param citizenid string
---@return table | nil
Framework.GetPlayerByIdentifier = function(citizenid)
local player = QBCore.Functions.GetPlayerByCitizenId(citizenid)
if not player then return end
return player
end
---@description This will return the player source of the specified citizen ID.
---@param citizenid string
---@return number | nil
Framework.GetPlayerSource = function(citizenid)
local player = Framework.GetPlayerByIdentifier(citizenid)
if not player then return end
return player.PlayerData.source
end
---@description This will return the jobs registered in the framework in a table. ---@description This will return the jobs registered in the framework in a table.
---@return table {name = jobName, label = jobLabel, grade = {name = gradeName, level = gradeLevel}} ---@return table {name = jobName, label = jobLabel, grade = {name = gradeName, level = gradeLevel}}
Framework.GetFrameworkJobs = function() Framework.GetFrameworkJobs = function()
+19
View File
@@ -44,6 +44,25 @@ Framework.GetPlayer = function(src)
return player return player
end end
---@description Returns the player data of the specified identifier in the framework defualt format.
---@param citizenid string
---@return table | nil
Framework.GetPlayerByIdentifier = function(citizenid)
local player = QBox:GetPlayerByCitizenId(citizenid)
if not player then return end
return player
end
---@description This will return the player source of the specified citizen ID.
---@param citizenid string
---@return number | nil
Framework.GetPlayerSource = function(citizenid)
local player = Framework.GetPlayerByIdentifier(citizenid)
if not player then return end
return player.PlayerData.source
end
---@description Returns a table of the jobs in the framework. ---@description Returns a table of the jobs in the framework.
---@return table ---@return table
Framework.GetFrameworkJobs = function() Framework.GetFrameworkJobs = function()
+2 -2
View File
@@ -87,10 +87,10 @@ function OxToQBInput(data)
input.options = {} input.options = {}
if v.options then -- Checks if options varible is valid so checkboxes are bundled together (not used by ox for each checkpoint) if v.options then -- Checks if options varible is valid so checkboxes are bundled together (not used by ox for each checkpoint)
for k, j in pairs(v.options) do for k, j in pairs(v.options) do
table.insert(input.options, {value = j.value, text = j.label, checked = j.checked}) -- added checked option (used to show box as ticked or not) table.insert(input.options, {value = #returnData + #input.options + 1, text = j.label, checked = j.checked}) -- added checked option (used to show box as ticked or not)
end end
else -- If options is not valid or people pass a single checkbox then it will be a single checkbox per entry else -- If options is not valid or people pass a single checkbox then it will be a single checkbox per entry
table.insert(input.options, {value = v.value, text = v.label, checked = v.checked}) -- Kept value just incase it's used for other stuffs table.insert(input.options, {value = #returnData + 1, text = v.label, checked = v.checked}) -- Kept value just incase it's used for other stuffs
end end
end end
table.insert(returnData, input) table.insert(returnData, input)
+1
View File
@@ -33,6 +33,7 @@ function Input.Open(title, data, isQBFormat, submitText)
for i, v in pairs(returnData) do for i, v in pairs(returnData) do
local index = i and tonumber(i) local index = i and tonumber(i)
v = tostring(v) == "true" and true or (tostring(v) == "false" and false or v)
if not index then if not index then
table.insert(convertedData, v) table.insert(convertedData, v)
else else
+1 -1
View File
@@ -235,7 +235,7 @@ Inventory.UpdatePlate = function(oldplate, newplate)
trunk_oldplate = 'trunk-' .. oldplate trunk_oldplate = 'trunk-' .. oldplate
} }
MySQL.transaction.await(queries, values) MySQL.transaction.await(queries, values)
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
+1 -1
View File
@@ -102,7 +102,7 @@ Inventory.UpdatePlate = function(oldplate, newplate)
} }
local values = { newplate = newplate, oldplate = oldplate } local values = { newplate = newplate, oldplate = oldplate }
MySQL.transaction.await(queries, values) MySQL.transaction.await(queries, values)
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
@@ -229,7 +229,7 @@ Inventory.UpdatePlate = function(oldplate, newplate)
} }
local values = { newplate = newplate, oldplate = oldplate } local values = { newplate = newplate, oldplate = oldplate }
MySQL.transaction.await(queries, values) MySQL.transaction.await(queries, values)
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
+1 -1
View File
@@ -179,7 +179,7 @@ end
Inventory.UpdatePlate = function(oldplate, newplate) Inventory.UpdatePlate = function(oldplate, newplate)
ox_inventory:UpdateVehicle(oldplate, newplate) ox_inventory:UpdateVehicle(oldplate, newplate)
-- ox standard doesnt return anything so probably shouldnt return so everything else has the same standard. Yeaaaa probably should change this. -- ox standard doesnt return anything so probably shouldnt return so everything else has the same standard. Yeaaaa probably should change this.
if GetResourceState('jg-mechanic') ~= 'missing' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
+1 -1
View File
@@ -122,7 +122,7 @@ Inventory.UpdatePlate = function(oldplate, newplate)
local values = { newplate = newplate, oldplate = oldplate } local values = { newplate = newplate, oldplate = oldplate }
MySQL.transaction.await(queries, values) MySQL.transaction.await(queries, values)
-- ox standard doesnt return anything so probably shouldnt return so everything else has the same standard. Yeaaaa probably should change this. -- ox standard doesnt return anything so probably shouldnt return so everything else has the same standard. Yeaaaa probably should change this.
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
+6 -3
View File
@@ -12,7 +12,10 @@ Inventory.Version = nil
Inventory.ShopData = {} Inventory.ShopData = {}
local function getInventoryNewVersion() local function getInventoryNewVersion()
if tonumber(string.sub(GetResourceMetadata("qb-inventory", "version", 0), 1, 1)) >= 2 then Inventory.Version = true end if tonumber(string.sub(GetResourceMetadata("qb-inventory", "version", 0), 1, 1)) >= 2 then
Inventory.Version = true
return
end
Inventory.Version = false Inventory.Version = false
end end
@@ -206,7 +209,7 @@ Inventory.UpdatePlate = function(oldplate, newplate)
qbInventory:SetInventory('glovebox-'..newplate, storedGloveBox.items, "Community Bridge Moving Items In GloveBox") qbInventory:SetInventory('glovebox-'..newplate, storedGloveBox.items, "Community Bridge Moving Items In GloveBox")
qbInventory:CreateInventory('trunk-'..newplate, {label = 'trunk-'..newplate, slots = storedTrunk.slots, maxweight = storedTrunk.maxweight}) qbInventory:CreateInventory('trunk-'..newplate, {label = 'trunk-'..newplate, slots = storedTrunk.slots, maxweight = storedTrunk.maxweight})
qbInventory:SetInventory('trunk-'..newplate, storedTrunk.items, "Community Bridge Moving Items In Trunk") qbInventory:SetInventory('trunk-'..newplate, storedTrunk.items, "Community Bridge Moving Items In Trunk")
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
@@ -269,7 +272,7 @@ Inventory.Old.UpdatePlate = function(oldplate, newplate)
} }
local values = { newplate = newplate, oldplate = oldplate } local values = { newplate = newplate, oldplate = oldplate }
MySQL.transaction.await(queries, values) MySQL.transaction.await(queries, values)
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
+1 -1
View File
@@ -178,7 +178,7 @@ Inventory.UpdatePlate = function(oldplate, newplate)
} }
local values = { newplate = newplate, oldplate = oldplate } local values = { newplate = newplate, oldplate = oldplate }
MySQL.transaction.await(queries, values) MySQL.transaction.await(queries, values)
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end
@@ -155,7 +155,7 @@ Inventory.UpdatePlate = function(oldplate, newplate)
local values = { newplate = newplate, oldplate = oldplate } local values = { newplate = newplate, oldplate = oldplate }
MySQL.transaction.await(queries, values) MySQL.transaction.await(queries, values)
tgiann:UpdateVehicle(oldplate, newplate) tgiann:UpdateVehicle(oldplate, newplate)
if GetResourceState('jg-mechanic') ~= 'started' then return true end if GetResourceState('jg-mechanic') == 'missing' then return true end
return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
end end