targets and inventory update
Targets: sphearzone should not take a heading, removed optional debug at the end for individual debugging Inventory: Added OpenPlayerInventory for all inventories. 2 (aka codem and qs) did not have clear documentation. Probably doesnt work
This commit is contained in:
1 parent
fc8da1d528
commit
466e86bfdb
13 files changed
+82
-6
No files matched your search
@@ -52,4 +52,6 @@ Inventory.Items = function()
|
|||||||
return Framework.Shared.Items
|
return Framework.Shared.Items
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -193,4 +193,8 @@ Inventory.StripPNG = function(item)
|
|||||||
return item
|
return item
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, targetSrc)
|
||||||
|
return false, Prints.Error("OpenPlayerInventory is not implemented in this inventory, because of this we dont have a way to open a players inventory.")
|
||||||
|
end
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -190,4 +190,13 @@ Inventory.GetImagePath = function(item)
|
|||||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
exports['codem-inventory']:OpenInventory(src, target)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -257,4 +257,14 @@ Inventory.Items = function()
|
|||||||
return core:getItemsList()
|
return core:getItemsList()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
local identifier = Framework.GetPlayerIdentifier(target)
|
||||||
|
if not identifier then return false end
|
||||||
|
exports.core_inventory:openInventory(src, 'stash-'.. identifier:gsub(':',''), 'stash', nil, nil, true, nil, false)
|
||||||
|
end
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -189,4 +189,14 @@ Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGrou
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
local identifier = Framework.GetPlayerIdentifier(target)
|
||||||
|
if not identifier then return false end
|
||||||
|
exports['jpr-inventory']:OpenInventory(src, identifier)
|
||||||
|
end
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -239,4 +239,12 @@ Inventory.GetImagePath = function(item)
|
|||||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
exports.origen_inventory:OpenInventory(src, "otherplayer", target)
|
||||||
|
end
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -224,4 +224,12 @@ Inventory.GetItem = function(src, item, metadata)
|
|||||||
return ox_inventory:GetItem(src, item, metadata, false)
|
return ox_inventory:GetItem(src, item, metadata, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
exports.ox_inventory:openInventory('player', target)
|
||||||
|
end
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -275,4 +275,12 @@ Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGrou
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
exports['qb-inventory']:OpenInventory(src, target)
|
||||||
|
end
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -233,4 +233,12 @@ Inventory.GetImagePath = function(item)
|
|||||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
exports['qs-inventory']:OpenInventory(src, target)
|
||||||
|
end
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -229,4 +229,13 @@ Inventory.GetItem = function(src, item, metadata)
|
|||||||
return item
|
return item
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Inventory.OpenPlayerInventory = function(src, target)
|
||||||
|
assert(src, "OpenPlayerInventory: src is required")
|
||||||
|
if not target then
|
||||||
|
target = src
|
||||||
|
end
|
||||||
|
exports['tgiann-inventory']:OpenInventoryById(src, target)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return Inventory
|
return Inventory
|
||||||
@@ -155,13 +155,13 @@ end
|
|||||||
---@param coords table
|
---@param coords table
|
||||||
---@param radius number
|
---@param radius number
|
||||||
---@param options table
|
---@param options table
|
||||||
Target.AddSphereZone = function(name, coords, radius, heading, options)
|
Target.AddSphereZone = function(name, coords, radius, options, debug)
|
||||||
options = Target.FixOptions(options)
|
options = Target.FixOptions(options)
|
||||||
local target = ox_target:addSphereZone({
|
local target = ox_target:addSphereZone({
|
||||||
coords = coords,
|
coords = coords,
|
||||||
radius = radius,
|
radius = radius,
|
||||||
name = name,
|
name = name,
|
||||||
debug = targetDebug,
|
debug = targetDebug or debug,
|
||||||
options = options
|
options = options
|
||||||
})
|
})
|
||||||
table.insert(targetZones, { name = name, id = target, creator = GetInvokingResource() })
|
table.insert(targetZones, { name = name, id = target, creator = GetInvokingResource() })
|
||||||
|
|||||||
@@ -170,11 +170,11 @@ end
|
|||||||
---@param coords table
|
---@param coords table
|
||||||
---@param radius number
|
---@param radius number
|
||||||
---@param options table
|
---@param options table
|
||||||
Target.AddSphereZone = function(name, coords, radius, options)
|
Target.AddSphereZone = function(name, coords, radius, options, debug)
|
||||||
options = Target.FixOptions(options)
|
options = Target.FixOptions(options)
|
||||||
qb_target:AddCircleZone(name, coords, radius, {
|
qb_target:AddCircleZone(name, coords, radius, {
|
||||||
name = name,
|
name = name,
|
||||||
debugPoly = targetDebug,
|
debugPoly = targetDebug or debug,
|
||||||
}, {
|
}, {
|
||||||
options = options,
|
options = options,
|
||||||
distance = options.distance or 1.5,
|
distance = options.distance or 1.5,
|
||||||
|
|||||||
@@ -146,13 +146,13 @@ end
|
|||||||
---@param coords table
|
---@param coords table
|
||||||
---@param radius number
|
---@param radius number
|
||||||
---@param options table
|
---@param options table
|
||||||
Target.AddSphereZone = function(name, coords, radius, heading, options)
|
Target.AddSphereZone = function(name, coords, radius, options, debug)
|
||||||
options = Target.FixOptions(options)
|
options = Target.FixOptions(options)
|
||||||
local target = sleepless_interact:addSphereZone({
|
local target = sleepless_interact:addSphereZone({
|
||||||
coords = coords,
|
coords = coords,
|
||||||
radius = radius,
|
radius = radius,
|
||||||
name = name,
|
name = name,
|
||||||
debug = targetDebug,
|
debug = targetDebug or debug,
|
||||||
options = options
|
options = options
|
||||||
})
|
})
|
||||||
table.insert(targetZones, { name = name, id = target, creator = GetInvokingResource() })
|
table.insert(targetZones, { name = name, id = target, creator = GetInvokingResource() })
|
||||||
|
|||||||
Reference in new issue
Block a user