Merge pull request #184 from gononono64/dev

issue with qb-input checkboxes
This commit is contained in:
MrNewb authored and GitHub committed 2026-03-13 12:36:01 -04:00
commit 6c6a1b5bd3
2 files changed
+3 -2

No files matched your search

+2 -2
View File
@@ -87,10 +87,10 @@ function OxToQBInput(data)
input.options = {}
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
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
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
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
local index = i and tonumber(i)
v = tostring(v) == "true" and true or (tostring(v) == "false" and false or v)
if not index then
table.insert(convertedData, v)
else