✂️Snippets

Support for external shops

  • You can easily change shops created in other scripts by swapping out the inventory event with my custom event

    • If you have a script that opens a shop, you can swap out the event inventory:server:OpenInventory for jim-shops:ShopOpen and it will open in my shop layout instead of the default inventory layout

    • All my scripts have an option to toggle this in the config

    • But it's very unlikely someone elses script won't

  • For example:

  • in qb-ambulancejob > client > job.lua there is the event

RegisterNetEvent('qb-ambulancejob:armory', function()
    if onDuty then
        TriggerServerEvent("inventory:server:OpenInventory", "shop", "hospital", Config.Items)
    end
end)
  • Simply changing the event name from inventory:server:OpenInventory to jim-shops:ShopOpen will make it use my script instead

RegisterNetEvent('qb-ambulancejob:armory', function()
    if onDuty then
        TriggerServerEvent("jim-shops:ShopOpen", "shop", "hospital", Config.Items)
    end
end)

Last updated