Lumberjack Job entrega ítems reales del inventario: nueve tipos de madera y subproductos de los árboles, tres tablones del bloque de corte y las tres hachas que se venden en la tienda. Cada uno de ellos tiene que existir en la lista de ítems de tu inventario antes de que el primer jugador coja un hacha.
Los ítems#
Ítem | Etiqueta | De dónde sale | Precio |
|---|---|---|---|
| Pine wood | Cada pino | $5 |
| Pine resin | Pino, 20 % de probabilidad, hasta 3 | $7 |
| Wood Shavings | Pino, 10 % de probabilidad, hasta 2 | $9 |
| Oak wood | Cada roble | $6 |
| Oak Bark | Roble, 20 % de probabilidad, hasta 3 | $8 |
| Arcorn | Roble, 10 % de probabilidad, hasta 2 | $10 |
| Maple wood | Cada arce | $7 |
| Strong fiber | Arce, 20 % de probabilidad, hasta 3 | $9 |
| Maple syrup extract | Arce, 10 % de probabilidad, hasta 2 | $11 |
| Pine Wood Plank | Bloque de corte, a partir de | $10 |
| Oak Wood Plank | Bloque de corte, a partir de | $12 |
| Maple Wood Plank | Bloque de corte, a partir de | $14 |
| Rusty Axe | Tienda, nivel 1 | $50 de compra |
| Iron-Edged Axe | Tienda, nivel 3 | $300 de compra |
| Mythical Axe | Tienda, nivel 6 | $2,000 de compra |
Los precios son lo que paga la tienda por una unidad, leídos de Config.WoodTypes, Config.ChopWood y Config.AxeLevel. Renombrar un ítem significa renombrarlo en ambos sitios: la configuración y el inventario.
Imágenes de los ítems#
Las quince imágenes están en [qs-lumberjack-installation]/images, cada una con el nombre de su ítem. Cópialas en la carpeta de imágenes de tu inventario:
Inventario | Carpeta |
|---|---|
ox_inventory |
|
qs-inventory |
|
qb-inventory |
|
Añadir los ítems#
Elige la pestaña del inventario que usa tu servidor. Cada una ya incluye la forma correcta de equipar un hacha.
Añade a ox_inventory/data/items.lua:
-- Wood and by-products
['pine_wood'] = { label = 'Pine wood', weight = 250, close = true, description = 'A strong piece of pine wood.' },
['pine_resin'] = { label = 'Pine resin', weight = 150, close = true, description = 'Sticky resin extracted from pine trees.' },
['wood_shavings'] = { label = 'Wood Shavings', weight = 100, close = true, description = 'Fine shavings from wood carving.' },
['oak_wood'] = { label = 'Oak wood', weight = 250, close = true, description = 'A dense and durable oak wood log.' },
['oak_bark'] = { label = 'Oak Bark', weight = 150, close = true, description = 'Thick bark from an oak tree.' },
['arcorn'] = { label = 'Arcorn', weight = 100, close = true, description = 'A small arcorn, seed of the oak.' },
['maple_wood'] = { label = 'Maple wood', weight = 250, close = true, description = 'A smooth and solid maple wood log.' },
['strong_fiber'] = { label = 'Strong fiber', weight = 150, close = true, description = 'Durable natural fiber from tree bark.' },
['maple_syrup_extract'] = { label = 'Maple syrup extract', weight = 100, close = true, description = 'Thick extract used to make maple syrup.' },
-- Planks
['pinewood_plank'] = { label = 'Pine Wood Plank', weight = 100, close = true, description = 'A sturdy plank made from pine wood.' },
['oakwood_plank'] = { label = 'Oak Wood Plank', weight = 100, close = true, description = 'A solid plank crafted from oak wood.' },
['maplewood_plank'] = { label = 'Maple Wood Plank', weight = 100, close = true, description = 'A refined plank cut from maple wood.' },
-- Axes
['axe_rusty'] = {
label = 'Rusty Axe',
weight = 8,
stack = false,
close = true,
client = { export = 'qs-lumberjack.toggleAxe' },
},
['axe_iron'] = {
label = 'Iron-Edged Axe',
weight = 8,
stack = false,
close = true,
client = { export = 'qs-lumberjack.toggleAxe' },
},
['axe_mythical'] = {
label = 'Mythical Axe',
weight = 8,
stack = false,
close = true,
client = { export = 'qs-lumberjack.toggleAxe' },
},Añade a qs-inventory/shared/items.lua:
-- Wood and by-products
['pine_wood'] = { ['name'] = 'pine_wood', ['label'] = 'Pine wood', ['weight'] = 250, ['type'] = 'item', ['image'] = 'pine_wood.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'A strong piece of pine wood.' },
['pine_resin'] = { ['name'] = 'pine_resin', ['label'] = 'Pine resin', ['weight'] = 150, ['type'] = 'item', ['image'] = 'pine_resin.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'Sticky resin extracted from pine trees.' },
['wood_shavings'] = { ['name'] = 'wood_shavings', ['label'] = 'Wood Shavings', ['weight'] = 100, ['type'] = 'item', ['image'] = 'wood_shavings.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'Fine shavings from wood carving.' },
['oak_wood'] = { ['name'] = 'oak_wood', ['label'] = 'Oak wood', ['weight'] = 250, ['type'] = 'item', ['image'] = 'oak_wood.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'A dense and durable oak wood log.' },
['oak_bark'] = { ['name'] = 'oak_bark', ['label'] = 'Oak Bark', ['weight'] = 150, ['type'] = 'item', ['image'] = 'oak_bark.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'Thick bark from an oak tree.' },
['arcorn'] = { ['name'] = 'arcorn', ['label'] = 'Arcorn', ['weight'] = 100, ['type'] = 'item', ['image'] = 'arcorn.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'A small arcorn, seed of the oak.' },
['maple_wood'] = { ['name'] = 'maple_wood', ['label'] = 'Maple wood', ['weight'] = 250, ['type'] = 'item', ['image'] = 'maple_wood.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'A smooth and solid maple wood log.' },
['strong_fiber'] = { ['name'] = 'strong_fiber', ['label'] = 'Strong fiber', ['weight'] = 150, ['type'] = 'item', ['image'] = 'strong_fiber.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'Durable natural fiber from tree bark.' },
['maple_syrup_extract'] = { ['name'] = 'maple_syrup_extract', ['label'] = 'Maple syrup extract', ['weight'] = 100, ['type'] = 'item', ['image'] = 'maple_syrup_extract.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'Thick extract used to make maple syrup.' },
-- Planks
['pinewood_plank'] = { ['name'] = 'pinewood_plank', ['label'] = 'Pine Wood Plank', ['weight'] = 100, ['type'] = 'item', ['image'] = 'pinewood_plank.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'A sturdy plank made from pine wood.' },
['oakwood_plank'] = { ['name'] = 'oakwood_plank', ['label'] = 'Oak Wood Plank', ['weight'] = 100, ['type'] = 'item', ['image'] = 'oakwood_plank.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'A solid plank crafted from oak wood.' },
['maplewood_plank'] = { ['name'] = 'maplewood_plank', ['label'] = 'Maple Wood Plank', ['weight'] = 100, ['type'] = 'item', ['image'] = 'maplewood_plank.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['description'] = 'A refined plank cut from maple wood.' },
-- Axes
['axe_rusty'] = {
['name'] = 'axe_rusty', ['label'] = 'Rusty Axe', ['weight'] = 8, ['type'] = 'item', ['image'] = 'axe_rusty.png',
['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'A worn axe that still bites.',
client = { export = 'qs-lumberjack.toggleAxeQuasar' },
},
['axe_iron'] = {
['name'] = 'axe_iron', ['label'] = 'Iron-Edged Axe', ['weight'] = 8, ['type'] = 'item', ['image'] = 'axe_iron.png',
['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'A sturdy axe with an iron edge.',
client = { export = 'qs-lumberjack.toggleAxeQuasar' },
},
['axe_mythical'] = {
['name'] = 'axe_mythical', ['label'] = 'Mythical Axe', ['weight'] = 8, ['type'] = 'item', ['image'] = 'axe_mythical.png',
['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'A legendary axe that fells anything.',
client = { export = 'qs-lumberjack.toggleAxeQuasar' },
},Para qb-inventory, añade a qb-core/shared/items.lua. El script registra las hachas como ítems usables al arrancar, así que no necesitan nada más.
-- Wood and by-products
pine_wood = { name = 'pine_wood', label = 'Pine wood', weight = 250, type = 'item', image = 'pine_wood.png', unique = false, useable = false, shouldClose = true, description = 'A strong piece of pine wood.' },
pine_resin = { name = 'pine_resin', label = 'Pine resin', weight = 150, type = 'item', image = 'pine_resin.png', unique = false, useable = false, shouldClose = true, description = 'Sticky resin extracted from pine trees.' },
wood_shavings = { name = 'wood_shavings', label = 'Wood Shavings', weight = 100, type = 'item', image = 'wood_shavings.png', unique = false, useable = false, shouldClose = true, description = 'Fine shavings from wood carving.' },
oak_wood = { name = 'oak_wood', label = 'Oak wood', weight = 250, type = 'item', image = 'oak_wood.png', unique = false, useable = false, shouldClose = true, description = 'A dense and durable oak wood log.' },
oak_bark = { name = 'oak_bark', label = 'Oak Bark', weight = 150, type = 'item', image = 'oak_bark.png', unique = false, useable = false, shouldClose = true, description = 'Thick bark from an oak tree.' },
arcorn = { name = 'arcorn', label = 'Arcorn', weight = 100, type = 'item', image = 'arcorn.png', unique = false, useable = false, shouldClose = true, description = 'A small arcorn, seed of the oak.' },
maple_wood = { name = 'maple_wood', label = 'Maple wood', weight = 250, type = 'item', image = 'maple_wood.png', unique = false, useable = false, shouldClose = true, description = 'A smooth and solid maple wood log.' },
strong_fiber = { name = 'strong_fiber', label = 'Strong fiber', weight = 150, type = 'item', image = 'strong_fiber.png', unique = false, useable = false, shouldClose = true, description = 'Durable natural fiber from tree bark.' },
maple_syrup_extract = { name = 'maple_syrup_extract', label = 'Maple syrup extract', weight = 100, type = 'item', image = 'maple_syrup_extract.png', unique = false, useable = false, shouldClose = true, description = 'Thick extract used to make maple syrup.' },
-- Planks
pinewood_plank = { name = 'pinewood_plank', label = 'Pine Wood Plank', weight = 100, type = 'item', image = 'pinewood_plank.png', unique = false, useable = false, shouldClose = true, description = 'A sturdy plank made from pine wood.' },
oakwood_plank = { name = 'oakwood_plank', label = 'Oak Wood Plank', weight = 100, type = 'item', image = 'oakwood_plank.png', unique = false, useable = false, shouldClose = true, description = 'A solid plank crafted from oak wood.' },
maplewood_plank = { name = 'maplewood_plank', label = 'Maple Wood Plank', weight = 100, type = 'item', image = 'maplewood_plank.png', unique = false, useable = false, shouldClose = true, description = 'A refined plank cut from maple wood.' },
-- Axes
axe_rusty = { name = 'axe_rusty', label = 'Rusty Axe', weight = 8, type = 'item', image = 'axe_rusty.png', unique = true, useable = true, shouldClose = true, description = 'A worn axe that still bites.' },
axe_iron = { name = 'axe_iron', label = 'Iron-Edged Axe', weight = 8, type = 'item', image = 'axe_iron.png', unique = true, useable = true, shouldClose = true, description = 'A sturdy axe with an iron edge.' },
axe_mythical = { name = 'axe_mythical', label = 'Mythical Axe', weight = 8, type = 'item', image = 'axe_mythical.png', unique = true, useable = true, shouldClose = true, description = 'A legendary axe that fells anything.' },Qbox funciona con ox_inventory, así que los ítems van en ox_inventory/data/items.lua exactamente como en la pestaña ox_inventory, hachas incluidas, con su export qs-lumberjack.toggleAxe.
Con el inventario por defecto de ESX, ejecuta esto en tu base de datos. El script registra las hachas como ítems usables al arrancar.
INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('pine_wood', 'Pine wood', 1, 0, 1),
('pine_resin', 'Pine resin', 1, 0, 1),
('wood_shavings', 'Wood Shavings', 1, 0, 1),
('oak_wood', 'Oak wood', 1, 0, 1),
('oak_bark', 'Oak Bark', 1, 0, 1),
('arcorn', 'Arcorn', 1, 0, 1),
('maple_wood', 'Maple wood', 1, 0, 1),
('strong_fiber', 'Strong fiber', 1, 0, 1),
('maple_syrup_extract', 'Maple syrup extract', 1, 0, 1),
('pinewood_plank', 'Pine Wood Plank', 1, 0, 1),
('oakwood_plank', 'Oak Wood Plank', 1, 0, 1),
('maplewood_plank', 'Maple Wood Plank', 1, 0, 1),
('axe_rusty', 'Rusty Axe', 1, 0, 1),
('axe_iron', 'Iron-Edged Axe', 1, 0, 1),
('axe_mythical', 'Mythical Axe', 1, 0, 1);¿Usas ESX con ox_inventory o qs-inventory? Usa la pestaña de ese inventario: la tabla items no se lee en ese caso.
Equipar un hacha#
Usar un hacha desde el inventario la pone en la mano del jugador; usarla de nuevo la guarda. Cómo llega el uso al script depende del inventario, y las definiciones de ítems de arriba ya lo conectan:
Inventario | Qué equipa el hacha |
|---|---|
ox_inventory | El export de cliente del ítem |
qs-inventory | El export de cliente del ítem |
qb-inventory, ESX | Un ítem usable que el propio script registra para cada hacha de |
Si dos de esas vías responden al mismo clic, la segunda se ignora, así el hacha nunca sale y vuelve a entrar de golpe. Un hacha dada con /giveitem también funciona, con o sin metadatos.
Durabilidad#
Cada golpe a un árbol le cuesta al hacha el durabilitypenalty del árbol (1 por defecto). En ox_inventory la durabilidad restante se escribe en los metadatos del propio ítem, empezando por la durabilidad configurada del hacha, así cada hacha de una mochila se desgasta por separado. En cualquier otro inventario el script lleva la cuenta durante la sesión del jugador. Cuando llega a cero el hacha se rompe: sale de la mano y del inventario, y al jugador se le dice que compre una nueva.
Hachas que no son ítems#
Establece Config.InventoryAxe = false y la tienda pone el hacha directamente en la mano del jugador en lugar de en la mochila. Los tres ítems de hacha ya no son necesarios. El hacha se queda en la mano hasta que se rompe o se abandona la misión, y solo se puede llevar una a la vez.
Para retirar las hachas cuando una misión termina o se abandona, activa
Config.RemoveAxe.questFinishedoConfig.RemoveAxe.abandon. Solo se eliminan los nombres que están enConfig.AxeLevel.



