This commit is contained in:
Jim Shield
2025-03-08 20:55:05 +00:00
committed by GitHub
parent 6bfb549fd0
commit 83ba74bc12
6 changed files with 21 additions and 37 deletions

View File

@@ -168,7 +168,7 @@ function craftingMenu(data)
headertxt = data.craftable.Headertxt,
onBack = data.onBack or nil,
canClose = true,
onExit = function() end,
onExit = data.onExit or (function() end),
})
lookEnt(data.coords)
end

View File

@@ -10,23 +10,6 @@
When running client-side (not on the server), the module checks the player's Ped after they load.
Usage Examples:
-- Check if the player's Ped is an animal:
local animalStatus = isPedAnimal()
-- Check if a given Ped is a cat:
if isCat(somePed) then print("This is a cat!") end
-- Determine if a Ped is a dog and whether it's big or small:
local isDogFlag, isBig = isDog(somePed)
-- Retrieve a flat list of all animal model hashes:
local allAnimalModels = getAnimalModels()
File Separation Suggestion:
For scalability, consider separating this module into two files:
• AnimalDetection.lua (for functions and callbacks)
• AnimalPedsData.lua (for the AnimalPeds table)
]]
-- Global animal classification flags.

View File

@@ -354,7 +354,7 @@ function getDurability(item)
local durability = nil
if isStarted(QBInv) or isStarted(PSInv) then
local itemcheck = Core.Functions.GetPlayerData().items
for _, v in pairs(itemcheck) do
for k, v in pairs(itemcheck) do
if v.name == item then
if v.slot <= lowestSlot then
lowestSlot = v.slot
@@ -366,7 +366,7 @@ function getDurability(item)
if isStarted(OXInv) then
local itemcheck = exports[OXInv]:Search('slots', item)
for _, v in pairs(itemcheck) do
for k, v in pairs(itemcheck) do
if v.slot <= lowestSlot then
debugPrint(v.slot, itemcheck[k].metadata.durability)
lowestSlot = v.slot

View File

@@ -28,7 +28,7 @@ function GetPlayer(source)
return exports[QBXExport]:GetCoreObject().Functions.GetPlayer(source)
elseif isStarted(ESXExport) then
debugPrint("^6Bridge^7: ^3GetPlayer^7() ESXExport")
return exports[ESXExport]:GetPlayerFromId(source)
return ESX.GetPlayerFromId(source)
elseif isStarted(OXCoreExport) then
debugPrint("^6Bridge^7: ^3GetPlayer^7() OXCoreExport")
return exports[OXCoreExport]:GetPlayer(source)

View File

@@ -20,6 +20,8 @@
--- ```
function getSocietyAccount(society)
local bankScript, amount = "", 0
if society == nil or society == "none" then return amount end
if isStarted("qb-banking") then
bankScript = "qb-banking"
if not exports["qb-banking"]:GetAccount(society) then
@@ -35,11 +37,11 @@ function getSocietyAccount(society)
end
amount = exports["qb-banking"]:GetAccountBalance(society)
elseif isStarted("esx_society") then
bankScript = "esx_society"
-- Since esx_society does not have a native client export for retrieving money,
-- we use a server callback to get the final amount.
amount = triggerCallback(getScript() .. ":getESXSocietyAccount", society) or 0
--elseif isStarted("esx_society") then
-- bankScript = "esx_society"
-- -- Since esx_society does not have a native client export for retrieving money,
-- -- we use a server callback to get the final amount.
-- amount = triggerCallback(getScript()..":getESXSocietyAccount", society) or 0
elseif isStarted("Renewed-Banking") then
bankScript = "Renewed-Banking"
@@ -85,9 +87,9 @@ function chargeSociety(society, amount)
end
end
exports["qb-banking"]:RemoveMoney(society, amount)
elseif isStarted("esx_society") then
bankScript = "esx_society"
TriggerEvent("esx_society:withdrawMoney", society, amount)
--elseif isStarted("esx_society") then
-- bankScript = "esx_society"
-- TriggerEvent("esx_society:withdrawMoney", society, amount)
elseif isStarted("Renewed-Banking") then
bankScript = "Renewed-Banking"
@@ -138,12 +140,12 @@ function fundSociety(society, amount)
end
exports["qb-banking"]:AddMoney(society, amount)
elseif isStarted("esx_society") then
bankScript = "esx_society"
-- Use the esx_society event to deposit money.
TriggerServerEvent('esx_society:depositMoney', society, amount)
-- Use callback to return the updated balance.
newAmount = triggerCallback(getScript() .. ":getESXSocietyAccount", society) or 0
--elseif isStarted("esx_society") then
-- bankScript = "esx_society"
-- -- Use the esx_society event to deposit money.
-- TriggerServerEvent('esx_society:depositMoney', society, amount)
-- -- Use callback to return the updated balance.
-- newAmount = triggerCallback(getScript()..":getESXSocietyAccount", society) or 0
elseif isStarted("Renewed-Banking") then
bankScript = "Renewed-Banking"
@@ -170,7 +172,7 @@ end
-- other
if isStarted("esx_society") then
createCallback(getScript() .. ":getESXSocietyAccount", function(source, society)
createCallback(getScript()..":getESXSocietyAccount", function(source, society)
-- Example query adjust table/field names to match your esx_society implementation.
local result = MySQL.scalar.await('SELECT money FROM society_money WHERE society = ?', { society })
return result or 0

View File

@@ -48,7 +48,6 @@ function GetStashTimeout(stashName, stop)
stash = stashCache[stashName]
else
debugPrint("^6Bridge^7: ^2Local Stash ^7'^3"..stashName.."^7'^2 cache found^7")
("^6Bridge^7: ^2Local Stash '^3"..stashName.."^7' cache found")
end
-- If there are already items in cache, skip recheck.