[OX_INVENTORY] store settings

  • How can I make it so that when I buy 1 item I get more, for example for ammunition?
  • Can I make that when I buy a weapon it appears with accessories?

You can simply put any number while purchasing item.

For weapon with accessories you can make a useable combo item and define gun name and accessories.
THis is useable item code and you can add in server.lua of any script or just add in basic needs

ESX.RegisterUsableItem('pistolcombo', function(source)
	local xPlayer = ESX.GetPlayerFromId(source)

	xPlayer.removeInventoryItem('pistolcombo', 1)

    xPlayer.addInventoryItem("WEAPON_COMBATPISTOL", 1)
    xPlayer.addInventoryItem("at_skin_luxe", 1)
    xPlayer.addInventoryItem("ammo-9", 100)
    xPlayer.addInventoryItem("at_clip_extended_pistol", 1)
end)

Then add **pistolcombo** item in ox_inventory items.lua or in database abd sell this in shops

I had seen this option, but it is not the best, I wanted what I mentioned before, that you buy 1 and you get so many, so you don’t have to be changing between quantities, or for example for the police, that only takes x amount and do not have to be changing it.