OrigenNetwork
Docs

Installation · origen_graffiti

1. SQL

Run sql/install.sql or let the resource auto-create the table on first start:

sql
CREATE TABLE IF NOT EXISTS `graffiti_tags` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `quad_data` LONGTEXT NOT NULL,
  `strokes_data` LONGTEXT NOT NULL,
  `created_by` VARCHAR(64) NULL DEFAULT NULL,
  `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `center_x` DOUBLE NULL DEFAULT NULL,
  `center_y` DOUBLE NULL DEFAULT NULL,
  `center_z` DOUBLE NULL DEFAULT NULL,
  `image_url` VARCHAR(768) NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_graffiti_center` (`center_x`, `center_y`, `center_z`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

2. Fivemanage API Key

Add to your server.cfg:

text
set graffiti_fivemanage_key "YOUR_API_KEY_HERE"

The API key must not be in source code. Only set it via server.cfg. Get your key at docs.fivemanage.com.

3. Items

Add the two required items to your inventory. Only graffiti_spray and graffiti_eraser are needed.

ox_inventory — data/items.lua

lua
['graffiti_spray'] = {
    label       = 'Spray Paint',
    weight      = 300,
    stack       = false,
    close       = true,
    description = 'A can of spray paint. Color and durability stored in metadata.',
    client      = { image = 'graffiti_spray.png' },
},
 
['graffiti_eraser'] = {
    label       = 'Graffiti Eraser',
    weight      = 200,
    stack       = false,
    close       = true,
    description = 'Removes graffiti strokes from a canvas. Has limited uses.',
    client      = { image = 'graffiti_eraser.png' },
},

qb-core / qbx-core — qb-core/shared/items.lua

lua
['graffiti_spray'] = {
    name        = 'graffiti_spray',
    label       = 'Spray Paint',
    weight      = 300,
    type        = 'item',
    image       = 'graffiti_spray.png',
    unique      = true,
    useable     = true,
    shouldClose = true,
    combinable  = nil,
    description = 'A can of spray paint. Color and durability stored in metadata.',
},
 
['graffiti_eraser'] = {
    name        = 'graffiti_eraser',
    label       = 'Graffiti Eraser',
    weight      = 200,
    type        = 'item',
    image       = 'graffiti_eraser.png',
    unique      = true,
    useable     = true,
    shouldClose = true,
    combinable  = nil,
    description = 'Removes graffiti strokes from a canvas. Has limited uses.',
},

ESX — SQL

sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
    ('graffiti_spray',  'Spray Paint',     300, 0, 1),
    ('graffiti_eraser', 'Graffiti Eraser', 200, 0, 1);

Item metadata reference

Both items carry metadata set automatically by the shop at purchase time:

ItemFieldDescription
graffiti_spraymetadata.colorHex color string, e.g. #CC2222. nil = free-color spray
graffiti_spraymetadata.durabilityInteger 0–100, decreases as you paint
graffiti_erasermetadata.durabilityInteger 0–100, decreases per erase use

4. server.cfg

text
ensure origen_graffiti