GIG ScriptsGIG Scripts

Name Badges

A small badge on your chest with a name or title, visible to everyone nearby.

Dependencies

  • ox_lib
  • oxmysql
  • Qbox, QB-Core or ESX
server.cfg
ensure gig-nameBadges

The badge props are streamed by the resource itself, so no asset pack is needed. Up to 64 players can wear a badge at the same time.

Items

ItemPurpose
namebadgeopens the editor, or removes your badge if you already wear one

The item is optional. cfg.command gives the same thing as /namebadge. Set either to false to turn it off. The icon is icons/namebadge.png.

ox_inventory/data/items.lua
['namebadge'] = {
    label = 'Name Badge',
    weight = 10,
    stack = false,
    close = true,
    description = 'A customizable name badge that you can pin to your shirt.',
},
qb-core/shared/items.lua
['namebadge'] = { name = 'namebadge', label = 'Name Badge', weight = 10, type = 'item', image = 'namebadge.png', unique = false, useable = true, shouldClose = true, description = 'A customizable name badge.' },

Config

cfg.allowedJobs decides who can wear one. The value is the minimum job grade:

allowedJobs = {
    ['everyone'] = 0, -- remove this line to enforce the job list below
    ['police'] = 0,
    ['ambulance'] = 2,
},

cfg.sqlSave = true keeps badges across relogs and restarts, keyed by the character. With false the badge is gone when the player disconnects.

Editor

The editor lets the player type the text, then place the badge: move it in three axes, rotate it, and preview it on the character with an orbit camera. The position is saved with the badge, so a badge on a jacket pocket stays there.

On this page