This is a tricky one to support
They handle their shops inside their script with no way to add one from the outside
They give the ability to trigger a shop from outside the script, but not create one
This just adds that trigger for now
The intention here is to try and add multiple "billing" script functions, so the user can pre-set it for scripts that use `jim_bridge`
Currently only handles `jim-payments`
Workaround function made to detect if new QB Inventory functions are available
This can be used in other situations like checking if a script is working correctly or not and the export has been registered
I've moved the framework caching to a new file `frameworkCache.lua`
This now caches the framework data once when `jim_bridge` starts
Then in `coreloader.lua` now, the information that is cached is now called from that script
This also includes better handling of ESX cached data and should stop errors
This greatly optimizes the loading of all my scripts and lowers server load to speed up server start times
I have been testing this for just under a week and 6 different test servers and it appears to work fine
I've separated the built-in custom native GTA Notifications, skillcheck and draw text targets to separate files to be loaded along side `jim_bridge`
This now makes it so they only load once instead of with every single script, and each one can call on it
This change also makes these systems able to be called outside of `jim_bridge`
For example in my test server I'm currently using:
```lua
function QBCore.Functions.Notify(text, texttype, length, icon)
CreateThread(function()
exports.jim_bridge:Notify(nil, text, icon)
end)
end
```
This should fix issues for crafting complaining inventories are open when they aren't
I was trying to use per inventory checks for them being open until I realised I could just use `IsNuiFocused()` for all inventories to check if there was an nui on the screen that used the mouse, this should be a good workaround for it
This appeared to only happen with `jim-mechanic` repair from stash, due to the stashitem's table not being sent to the function
Making it save an empty table to the database
But this was possible in other places too
I've added fallbacks for if it didn't receive a table, grab a fresh one from cache/database
This function was created to help create random numbers
When you create a table of items with a random hunger value for example
`hunger = math.random(10, 20)` this will be set at script start and never change
using `hunger = {10, 20}` and then calling this function will make it generate a random number every time
It also fallsback if it simply recieved a number instead of a table
-- For example:
-- local hunger = {10, 20}
-- local hungerAmount = GetRandomTiming(hunger)
-- print(hungerAmount) -- number between 10, 20
Mainly older inventories may have had issues with custom stash sizes when opening them
This should fix compatibility with changing slots and max weight with them on trigger
When collecting Jobs from the server it tries it's best to determine which role is the "Boss"
It checks first of the Job Grade label containing the word "Boss"
If it can't find it, it then uses the highest number grade and adds `.isBoss = true` to it
Found the real issue that was causing the scripts to not think you had items, basically reverting this change as i didn't like having it in the first place
Apparently qs-inv reports two variables on the item data for how you have
`count` and `amount`
while other inventories appear to only have one of those
I'm assuming for compatibility sake
Apparently the `count` is updated differently, and `hasItem()` was checking for this first
I've swapped round the checks and appears to work better