fix multicraft for qb-input side

I forgot to correct the result as qb-input returns strings, this fixes that

Also added a fallback for if the user deletes the value and tries to craft `nil`
This commit is contained in:
Jim Shield
2025-05-05 22:52:46 +01:00
parent a203657e2a
commit 1623feacf1

View File

@@ -251,6 +251,10 @@ function multiCraft(data)
end
if Config.System.Menu == "qb" then
if dialog["amount"] == nil or dialog["amount"] == "" then
dialog["amount"] = 1
end
dialog["amount"] = tonumber(dialog["amount"])
if dialog["amount"] > max or dialog["amount"] < 1 or dialog["amount"] == nil or dialog["amount"] == "" then
triggerNotify(nil, "Invalid Amount", "error")
craftingMenu(data)