Início › Documentação › Instalação · origen_graffiti
Executa sql/install.sql ou deixa o recurso criar a tabela automaticamente no primeiro arranque:
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;Adiciona isto ao teu server.cfg:
set graffiti_fivemanage_key "YOUR_API_KEY_HERE"A API key não deve estar no código-fonte. Define-a apenas através do server.cfg. Obtém a tua chave em docs.fivemanage.com.
Adiciona os dois itens necessários ao teu inventário. Só são precisos graffiti_spray e graffiti_eraser.
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);Ambos os itens trazem metadados atribuídos automaticamente pela loja no momento da compra:
| Item | Campo | Descrição |
|---|---|---|
graffiti_spray |
metadata.color |
Cadeia de cor hexadecimal, p. ex. #CC2222. nil = spray de cor livre |
graffiti_spray |
metadata.durability |
Inteiro de 0 a 100, diminui à medida que pintas |
graffiti_eraser |
metadata.durability |
Inteiro de 0 a 100, diminui a cada utilização ao apagar |
ensure origen_graffiti