7 files changed
+24
-6
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ lua54 'yes'
|
|||||||
use_experimental_fxv2_oal 'yes'
|
use_experimental_fxv2_oal 'yes'
|
||||||
author 'The Order of the Sacred Framework'
|
author 'The Order of the Sacred Framework'
|
||||||
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
|
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
|
||||||
version '0.1.6'
|
version '0.2.0'
|
||||||
|
|
||||||
shared_scripts {
|
shared_scripts {
|
||||||
'@ox_lib/init.lua',
|
'@ox_lib/init.lua',
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ Framework.RegisterUsableItem = function(itemName, cb)
|
|||||||
local func = function(src, item, itemData)
|
local func = function(src, item, itemData)
|
||||||
itemData = itemData or item
|
itemData = itemData or item
|
||||||
itemData.metadata = itemData.metadata or itemData.info or {}
|
itemData.metadata = itemData.metadata or itemData.info or {}
|
||||||
cb(src, itemName, itemData)
|
cb(src, itemData)
|
||||||
end
|
end
|
||||||
ESX.RegisterUsableItem(itemName, func)
|
ESX.RegisterUsableItem(itemName, func)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ Framework.RegisterUsableItem = function(itemName, cb)
|
|||||||
exports(itemName, function(event, item, inventory, slot, data)
|
exports(itemName, function(event, item, inventory, slot, data)
|
||||||
local slotData = exports.ox_inventory:GetSlot(inventory.id, slot)
|
local slotData = exports.ox_inventory:GetSlot(inventory.id, slot)
|
||||||
if event == 'usingItem' then
|
if event == 'usingItem' then
|
||||||
cb(inventory.id, item, slotData)
|
cb(inventory.id, slotData)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ Framework.RegisterUsableItem = function(itemName, cb)
|
|||||||
local func = function(src, item, itemData)
|
local func = function(src, item, itemData)
|
||||||
itemData = itemData or item
|
itemData = itemData or item
|
||||||
itemData.metadata = itemData.metadata or itemData.info or {}
|
itemData.metadata = itemData.metadata or itemData.info or {}
|
||||||
cb(src, itemName, itemData)
|
cb(src, itemData)
|
||||||
end
|
end
|
||||||
QBCore.Functions.CreateUseableItem(itemName, func)
|
QBCore.Functions.CreateUseableItem(itemName, func)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ Framework.RegisterUsableItem = function(itemName, cb)
|
|||||||
local func = function(src, item, itemData)
|
local func = function(src, item, itemData)
|
||||||
itemData = itemData or item
|
itemData = itemData or item
|
||||||
itemData.metadata = itemData.metadata or itemData.info or {}
|
itemData.metadata = itemData.metadata or itemData.info or {}
|
||||||
cb(src, itemName, itemData)
|
cb(src, itemData)
|
||||||
end
|
end
|
||||||
return QBox:CreateUseableItem(itemName, cb)
|
return QBox:CreateUseableItem(itemName, func)
|
||||||
end
|
end
|
||||||
@@ -21,6 +21,13 @@ Target.AddGlobalPlayer = function(options)
|
|||||||
ox_target:addGlobalPlayer(options)
|
ox_target:addGlobalPlayer(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Target.AddGlobalVehicle = function(options)
|
||||||
|
for k, v in pairs(options) do
|
||||||
|
options[k].onSelect = v.onSelect or v.action
|
||||||
|
end
|
||||||
|
ox_target:addGlobalVehicle(options)
|
||||||
|
end
|
||||||
|
|
||||||
Target.AddLocalEntity = function(entities, options)
|
Target.AddLocalEntity = function(entities, options)
|
||||||
for k, v in pairs(options) do
|
for k, v in pairs(options) do
|
||||||
options[k].onSelect = v.onSelect or v.action
|
options[k].onSelect = v.onSelect or v.action
|
||||||
|
|||||||
@@ -23,6 +23,17 @@ Target.AddGlobalPlayer = function(options)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Target.AddGlobalVehicle = function(options)
|
||||||
|
for k, v in pairs(options) do
|
||||||
|
options[k].action = v.action or v.onSelect
|
||||||
|
end
|
||||||
|
exports['qb-target']:AddGlobalVehicle({
|
||||||
|
options = options,
|
||||||
|
distance = options.distance or 1.5
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
Target.AddLocalEntity = function(entities, options)
|
Target.AddLocalEntity = function(entities, options)
|
||||||
for k, v in pairs(options) do
|
for k, v in pairs(options) do
|
||||||
options[k].action = v.action or v.onSelect
|
options[k].action = v.action or v.onSelect
|
||||||
|
|||||||
Reference in new issue
Block a user