Cards
| Item | Card | Icon |
|---|---|---|
id_card |
Identification Card | star |
driver_license |
Driver License | car |
weaponlicense |
Firearms Permit | gun |
police_id |
LSPD Law Enforcement | shield-halved |
fire_id |
LSFD Firefighter | fire-flame-curved |
ems_id |
EMS | star-of-life |
lawyerpass |
Bar Association | scale-balanced |
bailbonds_id |
Bail Enforcement | handcuffs |
Everything about a card, including its text, icon, colours and which fields show, is set in Config.Cards. Icons are Font Awesome 6 Free class names.
Adding a card
Copy an existing entry in Config.Cards, rename the key to your item name, and add the item to your inventory.
Adding the items
qb-inventory and codem-inventory (qb-core/shared/items.lua). id_card, driver_license, weaponlicense and lawyerpass already exist in QBCore. Add the rest:
police_id = { name = 'police_id', label = 'Police ID', weight = 0, type = 'item', image = 'police_id.png', unique = true, useable = true, shouldClose = true, description = 'LSPD credentials' },
fire_id = { name = 'fire_id', label = 'Fire Dept ID', weight = 0, type = 'item', image = 'fire_id.png', unique = true, useable = true, shouldClose = true, description = 'LSFD credentials' },
ems_id = { name = 'ems_id', label = 'EMS ID', weight = 0, type = 'item', image = 'ems_id.png', unique = true, useable = true, shouldClose = true, description = 'Medical services credentials' },
bailbonds_id = { name = 'bailbonds_id', label = 'Bail Enforcement', weight = 0, type = 'item', image = 'bailbonds_id.png', unique = true, useable = true, shouldClose = true, description = 'Bail enforcement license' },Add matching images to your inventory's image folder. You can copy id_card.png.
qb-inventory ships chat handlers for id_card and driver_license. Delete those CreateUseableItem blocks so the old chat message can't take over after a live restart.
ox_inventory (ox_inventory/data/items.lua). Each card needs server = { export = 'sbcards.<item name>' }:
['id_card'] = { label = 'ID Card', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.id_card' } },
['driver_license'] = { label = 'Driver License', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.driver_license' } },
['weaponlicense'] = { label = 'Weapon License', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.weaponlicense' } },
['police_id'] = { label = 'Police ID', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.police_id' } },
['fire_id'] = { label = 'Fire Dept ID', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.fire_id' } },
['ems_id'] = { label = 'EMS ID', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.ems_id' } },
['lawyerpass'] = { label = 'Lawyer Pass', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.lawyerpass' } },
['bailbonds_id'] = { label = 'Bail Enforcement', weight = 0, stack = false, close = true, consume = 0, server = { export = 'sbcards.bailbonds_id' } },Card fields
- The number field defaults to the citizen ID. The police card shows the QBCore callsign, or the citizen ID if there's none. The lawyer pass shows the pass's
idmetadata. - RANK shows the holder's current grade if their job matches the card's
job. Otherwise it shows the rank stamped on the card when it was issued, or the default. requireJob = trueon a card stops anyone without that job from showing it.
