Home › Documentation › Installation · origen_graffiti
Run sql/install.sql or let the resource auto-create the table on first start:
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;Add to your server.cfg:
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.
Add the two required items to your inventory. Only graffiti_spray and graffiti_eraser are needed.
data/items.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/shared/items.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.',
},INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('graffiti_spray', 'Spray Paint', 300, 0, 1),
('graffiti_eraser', 'Graffiti Eraser', 200, 0, 1);Both items carry metadata set automatically by the shop at purchase time:
| Item | Field | Description |
|---|---|---|
graffiti_spray | metadata.color | Hex color string, e.g. #CC2222. nil = free-color spray |
graffiti_spray | metadata.durability | Integer 0–100, decreases as you paint |
graffiti_eraser | metadata.durability | Integer 0–100, decreases per erase use |
ensure origen_graffiti