Lumberjack Job verteilt echte Inventar-Items: neun Arten von Holz und Nebenprodukten von den Bäumen, drei Bretter vom Hackklotz und die drei Äxte, die im Shop verkauft werden. Jedes davon muss in der Item-Liste deines Inventars existieren, bevor der erste Spieler eine Axt aufnimmt.
Die Items#
Item | Label | Woher es kommt | Preis |
|---|---|---|---|
| Pine wood | Jede Kiefer | $5 |
| Pine resin | Kiefer, 20 % Chance, bis zu 3 | $7 |
| Wood Shavings | Kiefer, 10 % Chance, bis zu 2 | $9 |
| Oak wood | Jede Eiche | $6 |
| Oak Bark | Eiche, 20 % Chance, bis zu 3 | $8 |
| Arcorn | Eiche, 10 % Chance, bis zu 2 | $10 |
| Maple wood | Jeder Ahorn | $7 |
| Strong fiber | Ahorn, 20 % Chance, bis zu 3 | $9 |
| Maple syrup extract | Ahorn, 10 % Chance, bis zu 2 | $11 |
| Pine Wood Plank | Hackklotz, aus | $10 |
| Oak Wood Plank | Hackklotz, aus | $12 |
| Maple Wood Plank | Hackklotz, aus | $14 |
| Rusty Axe | Shop, Level 1 | $50 zum Kaufen |
| Iron-Edged Axe | Shop, Level 3 | $300 zum Kaufen |
| Mythical Axe | Shop, Level 6 | $2,000 zum Kaufen |
Preise sind das, was der Shop für eine Einheit zahlt, gelesen aus Config.WoodTypes, Config.ChopWood und Config.AxeLevel. Ein Item umzubenennen bedeutet, es an beiden Stellen umzubenennen — in der Config und im Inventar.
Item-Bilder#
Alle fünfzehn Bilder liegen in [qs-lumberjack-installation]/images, jeweils nach ihrem Item benannt. Kopiere sie in den Bildordner deines Inventars:
Inventar | Ordner |
|---|---|
ox_inventory |
|
qs-inventory |
|
qb-inventory |
|
Die Items hinzufügen#
Wähle den Tab für das Inventar, das dein Server nutzt. Jeder enthält bereits den richtigen Weg, eine Axt auszurüsten.
Hinzufügen zu 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' },
},Hinzufügen zu 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' },
},Für qb-inventory, füge es hinzu zu qb-core/shared/items.lua. Die Äxte werden vom Script beim Start als nutzbare Items registriert, brauchen also nichts Zusätzliches.
-- 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 läuft auf ox_inventory, daher kommen die Items in ox_inventory/data/items.lua genau wie im ox_inventory-Tab — Äxte inklusive, mit ihrem qs-lumberjack.toggleAxe-Export.
Führe bei dem Standard-ESX-Inventar dies gegen deine Datenbank aus. Die Äxte werden vom Script beim Start als nutzbare Items registriert.
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);Nutzt du ESX mit ox_inventory oder qs-inventory? Verwende den Tab dieses Inventars — die Tabelle items wird dann nicht gelesen.
Eine Axt ausrüsten#
Eine Axt aus dem Inventar zu benutzen nimmt sie in die Hand des Spielers; erneutes Benutzen steckt sie weg. Wie die Benutzung das Script erreicht, hängt vom Inventar ab, und die Item-Definitionen oben verdrahten es bereits:
Inventar | Was die Axt ausrüstet |
|---|---|
ox_inventory | Der Client-Export des Items |
qs-inventory | Der Client-Export des Items |
qb-inventory, ESX | Ein nutzbares Item, das das Script selbst für jede Axt in |
Wenn zwei dieser Wege denselben Klick beantworten, wird der zweite ignoriert, damit die Axt nicht herauskommt und gleich wieder hineingeht. Eine Axt, die mit /giveitem vergeben wurde, funktioniert ebenfalls, mit oder ohne Metadaten.
Haltbarkeit#
Jeder Schlag auf einen Baum kostet die Axt den Wert durabilitypenalty des Baums (standardmäßig 1). Bei ox_inventory wird die verbleibende Haltbarkeit in die eigenen Metadaten des Items geschrieben, beginnend mit der konfigurierten Haltbarkeit der Axt, sodass jede Axt in einer Tasche einzeln verschleißt. Bei jedem anderen Inventar führt das Script die Zählung für die Sitzung des Spielers. Bei null zerbricht die Axt: Sie verlässt die Hand und das Inventar, und der Spieler wird aufgefordert, eine neue zu kaufen.
Äxte, die keine Items sind#
Setze Config.InventoryAxe = false und der Shop legt die Axt direkt in die Hand des Spielers statt in die Tasche. Die drei Axt-Items werden dann nicht gebraucht. Die Axt bleibt in der Hand, bis sie zerbricht oder die Mission abgebrochen wird, und es kann jeweils nur eine getragen werden.
Um die Äxte zurückzunehmen, wenn eine Mission endet oder abgebrochen wird, schalte
Config.RemoveAxe.questFinishedoderConfig.RemoveAxe.abandonein. Nur Namen, die inConfig.AxeLevelstehen, werden jemals entfernt.



