This has several changes
When crafting, it now checks if the inventory is open and stops crafting dead and warns the player with a print.
Multicraft now checks if you have space in your inventory for the items and limits the max amount craftable
Also fixes the "title" of the qb-input box when crafting
Also changed the anim flag for the "placing items" to hopefully keep you in place
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`
When a player logs out and back in (switches character) it was thinking that the `AuthEvent` was being called more than once, triggering a warning message
This should clear the event when a player unloads and then allows them to request a new one
This'll probably break it, (it works for me) but refactored the stash item check, it was calling `stashHasItem()` for every ingredient check, now it sends the whole table of ingredients per item to craft and checks them together instead of separately
Also removes a `Wait()`, as it shouldn't need it with this change..maybe
An attempt to speed up `multiCraft()` function creation logic
Before it created a table of items while it was trying to check them I've separated this so it just gets that out of the way and checks items in it's own `for` loop
Also added a `maxCreation` variable that users can edit if needed which decides how many of an item can be created (I'll change this soon probably to tie into the config options in scripts for multicraft again soon
Also removed a few `Wait()`s that were there to help it not get confused, but after testing I believe this didn't make a difference, let me know if there's any issues with stuff like it saying it can craft when you dont have the items
I think, if ox_inventory checks a stash that doesn't exist yet, it returns a boolean or `nil`
This checks for that and instead returns a table to hopefully stop the scripts from breaking
Completely overlooked that ox_target item variable is `items` not `item`
changes
```lua
item = opts[i].item or nil,
```
to:
```lua
items = opts[i].item or nil,
```
The slot data for CodeM apparently returns as a string, this fixes it trying to compare a string to a number
```lua
if v.name == item and v.slot <= lowestSlot then
```
to
```lua
if v.name == item and tonumber(v.slot) <= lowestSlot then
```
Added a check to the script start to get the current players duty (helpful if yours saves the duty through restarts)
Also added core specific triggers for job/duty changes to help keep these in sync
I unfortunately forgot to add this before when adding the extra exploit protection. Now demands an auth token before allowing crafting results to help reduce exploiters calling it externally
Nothing public uses this yet, but its very similar to QBCore which makes it very for me to support
Nothing special to note, just improves the integration for future ventures into RedM