made some changes to input and target

targets now accept event

fixed a check for .action passed to ox fix options

input will now return in qbs format if qb is used (passed as true).. this makes converting qb resources infinitely simpler
This commit is contained in:
Mr.Crowley committed 2025-07-29 05:22:55 -05:00
1 parent 6047c6d88c
commit a1e65a7dff
5 files changed
+33 -8

No files matched your search

+10 -4
View File
@@ -22,8 +22,13 @@ Target = Target or {}
Target.FixOptions = function(options)
for k, v in pairs(options) do
local action = v.onSelect or v.action
if not action then
print(("Target option (%s) %s is missing an 'onSelect' or 'action' function."):format(k, v.label))
if not action then
local _type = v.type
if _type and _type == "server" then
v.serverEvent = v.event
v.event = nil
end
else
local select = function(entityOrData)
if type(entityOrData) == 'table' then
@@ -31,9 +36,10 @@ Target.FixOptions = function(options)
end
return action(entityOrData)
end
options[k].onSelect = select
options[k].groups = v.job or v.groups
v.onSelect = select
end
v.groups = v.job or v.groups
end
return options
end