dd-cards · Getting started
Items & images
The six items dd-cards uses, ready to paste into ox_inventory or qb-core, plus where the images go.
dd-cards uses six items and registers none of them — items belong to your inventory, so they have to be added there.
Keep the names exactly as they are. They are what dd-cards asks the inventory for, and they can be
changed only by editing Config.Materials and Config.Items in
config/shared.lua to match.
| Item | Role |
|---|---|
ink | Consumed by every card, one unit per card |
paper_standard | The plain paper option in the designer |
paper_glossy | The coated paper option |
gold_foil | Optional premium finish |
business_card_box | Handed over at pickup; holds the ordered quantity |
business_card | A single card, taken out of a box |
Warning
The box and the card must not stack. Each carries its own metadata — which design it holds, and how many cards are left in the box — and stacking would merge cards from unrelated designs into one pile.
ox_inventory
Open ox_inventory/data/items.lua and paste these next to your existing items.
The export lines on the box and the card are what make them do something when used. Leave them in
place.
['ink'] = {
label = 'Ink',
weight = 100,
client = {
image = 'ink.png'
}
},
['paper_standard'] = {
label = 'Standard Paper',
weight = 50,
client = {
image = 'paper_standard.png'
}
},
['paper_glossy'] = {
label = 'Glossy Paper',
weight = 50,
client = {
image = 'paper_glossy.png'
}
},
['gold_foil'] = {
label = 'Gold Foil',
weight = 30,
client = {
image = 'gold_foil.png'
}
},
['business_card_box'] = {
label = 'Business Card Box',
weight = 400,
stack = false,
consume = 0,
client = {
image = 'business_card_box.png',
export = 'dd-cards.useCardBox'
}
},
['business_card'] = {
label = 'Business Card',
weight = 5,
stack = false,
consume = 0,
client = {
image = 'business_card.png',
export = 'dd-cards.useCard'
}
},
Then copy all six .png files from install/inventory/images into:
ox_inventory/web/images/
Restart the server after both steps — ox_inventory reads items.lua at start, so the items will not
appear until it does.
qb-inventory
Note
The items go in qb-core, not in qb-inventory. QBCore keeps the item list in the core resource and qb-inventory reads it from there.
Open qb-core/shared/items.lua and paste these next to your existing items. The box and the card
must stay unique = true and useable = true — without useable, nothing happens when a player
uses them.
-- dd-cards
ink = { name = 'ink', label = 'Ink', weight = 100, type = 'item', image = 'ink.png', unique = false, useable = false, shouldClose = false, description = 'Printer ink. Every business card needs some' },
paper_standard = { name = 'paper_standard', label = 'Standard Paper', weight = 50, type = 'item', image = 'paper_standard.png', unique = false, useable = false, shouldClose = false, description = 'Plain card stock for printing business cards' },
paper_glossy = { name = 'paper_glossy', label = 'Glossy Paper', weight = 50, type = 'item', image = 'paper_glossy.png', unique = false, useable = false, shouldClose = false, description = 'Coated card stock with a glossy finish' },
gold_foil = { name = 'gold_foil', label = 'Gold Foil', weight = 30, type = 'item', image = 'gold_foil.png', unique = false, useable = false, shouldClose = false, description = 'Foil leaf for a premium finish on business cards' },
business_card_box = { name = 'business_card_box', label = 'Business Card Box', weight = 400, type = 'item', image = 'business_card_box.png', unique = true, useable = true, shouldClose = false, description = 'A sealed box of printed business cards. Use it to take one out' },
business_card = { name = 'business_card', label = 'Business Card', weight = 5, type = 'item', image = 'business_card.png', unique = true, useable = true, shouldClose = true, description = 'Someone\'s business card. Use it to take a look' },
Then copy all six .png files from install/inventory/images into:
qb-inventory/html/images/
Restart the server after both steps — qb-core reads shared/items.lua at start.
Renaming an item
If a name collides with something already on your server, change it in both places:
- Your inventory's item list.
Config.Items(box and card) orConfig.Materials(the four materials) inconfig/shared.lua.
The names must match exactly, or nothing can be bought, consumed or handed out.