Compare commits
6
Commits
c60174a3b3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1edad425f | ||
|
|
8eb1ebbdef | ||
|
|
79f468d1aa | ||
|
|
056215d0ae | ||
|
|
db7cef893d | ||
|
|
c2c5483c87 |
No files matched your search
+14
-15
@@ -193,31 +193,30 @@ end
|
||||
local function chooseTank(tanks)
|
||||
if #tanks == 1 then return tanks[1] end
|
||||
|
||||
local selection = promise.new()
|
||||
local options = {}
|
||||
-- Im d4rk_lib-Design statt lib.registerContext (d4rk-rp-planung CLAUDE.md
|
||||
-- "Unser Design, nicht das von ox_lib", 10.10.2026). Beendet wird mit dem
|
||||
-- Knopf je Flasche oder ESC (= nil); blockiert wie vorher das promise.
|
||||
local eintraege = {}
|
||||
|
||||
for i = 1, #tanks do
|
||||
local tank = tanks[i]
|
||||
options[i] = {
|
||||
title = tank.label,
|
||||
description = locale('info.tank_remaining', formatTime(tank.oxygen),
|
||||
eintraege[i] = {
|
||||
id = tostring(i),
|
||||
titel = tank.label,
|
||||
unterzeile = locale('info.tank_remaining', formatTime(tank.oxygen),
|
||||
math.floor(tank.oxygen / tank.capacity * 100),
|
||||
tank.gas or '?', math.floor(tank.maxDepth or 0)),
|
||||
icon = 'fa-solid fa-bottle-water',
|
||||
onSelect = function() selection:resolve(tank) end
|
||||
symbol = 'wind',
|
||||
aktionen = { { id = 'waehlen', label = locale('menu.use_tank'), art = 'primaer' } },
|
||||
}
|
||||
end
|
||||
|
||||
lib.registerContext({
|
||||
id = 'd4rk_divegear_tanks',
|
||||
title = locale('menu.choose_tank'),
|
||||
options = options,
|
||||
onExit = function() selection:resolve(nil) end
|
||||
local wahl = exports.d4rk_lib:menu({
|
||||
titel = locale('menu.choose_tank'),
|
||||
eintraege = eintraege,
|
||||
})
|
||||
|
||||
lib.showContext('d4rk_divegear_tanks')
|
||||
|
||||
return Citizen.Await(selection)
|
||||
return type(wahl) == 'table' and tanks[tonumber(wahl.eintrag) or -1] or nil
|
||||
end
|
||||
|
||||
lib.callback.register('d4rk_divegear:client:fillTank', function(tanks)
|
||||
|
||||
+4
-2
@@ -53,11 +53,13 @@ local config = {
|
||||
--- Die Kleidungsstuecke im Kleiderladen, die statt `clothing` das Item
|
||||
--- ausgeben (d4rk_garment.item, angelegt mit /tauchartikel). drawable ist
|
||||
--- der LOKALE Index in der Sammlung, texture -1 = alle Farben.
|
||||
--- Weiblich (f): NOCH NICHT GEMESSEN - dort gibt es die Items erst, wenn
|
||||
--- die Kennungen hier stehen.
|
||||
--- Weiblich (f) gemessen am 29.09.2026 (Betreiber): dieselben Sammlungen und
|
||||
--- Indizes wie m - Flasche mp_f_christmas2017:1, Maske mp_f_christmas2017:0.
|
||||
kleidung = {
|
||||
{ pedset = 'm', komponente = 'c:8', collection = 'mp_m_christmas2017', drawable = 1, item = 'diving_tank' },
|
||||
{ pedset = 'm', komponente = 'p:1', collection = 'mp_m_christmas2017', drawable = 0, item = 'diving_mask' },
|
||||
{ pedset = 'f', komponente = 'c:8', collection = 'mp_f_christmas2017', drawable = 1, item = 'diving_tank' },
|
||||
{ pedset = 'f', komponente = 'p:1', collection = 'mp_f_christmas2017', drawable = 0, item = 'diving_mask' },
|
||||
},
|
||||
|
||||
--- Das Fuell-Item. NICHT ANGELEGT: Nachfuellen kommt spaeter ueber einen
|
||||
|
||||
@@ -14,6 +14,7 @@ shared_scripts {
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'@d4rk_lib/server/diagnose_shared.lua',
|
||||
'server/main.lua',
|
||||
-- /tauchartikel: die Items in d4rk_item anlegen, nur auf Zuruf (28.09.2026).
|
||||
'server/artikel.lua',
|
||||
|
||||
+2
-1
@@ -35,7 +35,8 @@
|
||||
"patrone_einsetzen": "Patrone wird eingesetzt..."
|
||||
},
|
||||
"menu": {
|
||||
"choose_tank": "Tauchflasche wählen"
|
||||
"choose_tank": "Tauchflasche wählen",
|
||||
"use_tank": "Diese Flasche"
|
||||
},
|
||||
"hud": {
|
||||
"air": "Luft",
|
||||
|
||||
+2
-1
@@ -35,7 +35,8 @@
|
||||
"patrone_einsetzen": "Inserting cartridge..."
|
||||
},
|
||||
"menu": {
|
||||
"choose_tank": "Choose an air tank"
|
||||
"choose_tank": "Choose an air tank",
|
||||
"use_tank": "Use this tank"
|
||||
},
|
||||
"hud": {
|
||||
"air": "Air",
|
||||
|
||||
+21
-22
@@ -10,7 +10,8 @@
|
||||
Geloeschtes zurueck"). Vorhandene Items werden NICHT angefasst - was im
|
||||
Panel gepflegt ist, gewinnt.
|
||||
|
||||
NUR AN DER SERVERKONSOLE (restricted, source 0).
|
||||
SERVERKONSOLE ODER ADMIN IM SPIEL (Diagnosebefehl, restricted group.admin,
|
||||
seit 07.10.2026 - vorher nur source 0; Ausgabe in die F8-Konsole, #81).
|
||||
|
||||
Taucherflasche Kleidung (Kleiderladen, d4rk_garment -> item). Traegt
|
||||
die Patrone in der Metadata. Gewicht GESETZT: Geraet
|
||||
@@ -81,7 +82,7 @@ local function kleidungAnlegen()
|
||||
local ok, zeilen = pcall(function() return exports[ITEMS]:adminGarmentList() end)
|
||||
|
||||
if not ok or type(zeilen) ~= 'table' then
|
||||
print('^1 Kleidung: adminGarmentList antwortet nicht - UNGUELTIG, nichts angelegt.^7')
|
||||
sag('^1 Kleidung: adminGarmentList antwortet nicht - UNGUELTIG, nichts angelegt.^7')
|
||||
return
|
||||
end
|
||||
|
||||
@@ -99,7 +100,7 @@ local function kleidungAnlegen()
|
||||
local name = ('%s %s %s:%d'):format(k.pedset, k.komponente, k.collection, k.drawable)
|
||||
|
||||
if vorhanden then
|
||||
print((' Kleidung %-34s vorhanden (Item %s)%s'):format(name, tostring(vorhanden.item),
|
||||
sag((' Kleidung %-34s vorhanden (Item %s)%s'):format(name, tostring(vorhanden.item),
|
||||
vorhanden.item == k.item and '' or ' ^3- soll ' .. k.item .. ', im Panel pruefen^7'))
|
||||
else
|
||||
local okC, erfolg, grund = pcall(function()
|
||||
@@ -110,27 +111,26 @@ local function kleidungAnlegen()
|
||||
})
|
||||
end)
|
||||
|
||||
print((' Kleidung %-34s %s'):format(name,
|
||||
sag((' Kleidung %-34s %s'):format(name,
|
||||
(okC and erfolg == true) and '^2angelegt -> ' .. k.item .. '^7'
|
||||
or ('^1FEHLER: %s^7'):format(okC and tostring(grund) or tostring(erfolg))))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterCommand('tauchartikel', function(source, args)
|
||||
if source ~= 0 then return end
|
||||
Diagnosebefehl('tauchartikel', { restricted = 'group.admin' }, function(source, args)
|
||||
|
||||
local nachziehen = args[1] == 'nachziehen'
|
||||
|
||||
if GetResourceState(ITEMS) ~= 'started' then
|
||||
print('^1[d4rk_divegear] tauchartikel: d4rk_items laeuft nicht - nichts angelegt.^7')
|
||||
sag('^1[d4rk_divegear] tauchartikel: d4rk_items laeuft nicht - nichts angelegt.^7')
|
||||
return
|
||||
end
|
||||
|
||||
local ok, zeilen = pcall(function() return exports[ITEMS]:adminItemList() end)
|
||||
|
||||
if not ok or type(zeilen) ~= 'table' then
|
||||
print('^1[d4rk_divegear] tauchartikel: adminItemList antwortet nicht - UNGUELTIG, nichts angelegt.^7')
|
||||
sag('^1[d4rk_divegear] tauchartikel: adminItemList antwortet nicht - UNGUELTIG, nichts angelegt.^7')
|
||||
return
|
||||
end
|
||||
|
||||
@@ -140,11 +140,11 @@ RegisterCommand('tauchartikel', function(source, args)
|
||||
-- GEGENPROBE: eine leere Liste hiesse "d4rk_items kennt kein einziges
|
||||
-- Item" - das ist nie wahr, sondern eine kaputte Antwort.
|
||||
if next(da) == nil then
|
||||
print('^1[d4rk_divegear] tauchartikel: adminItemList lieferte 0 Items - UNGUELTIG, nichts angelegt.^7')
|
||||
sag('^1[d4rk_divegear] tauchartikel: adminItemList lieferte 0 Items - UNGUELTIG, nichts angelegt.^7')
|
||||
return
|
||||
end
|
||||
|
||||
print(('[d4rk_divegear] tauchartikel: %d Items in d4rk_item bekannt.'):format(#zeilen))
|
||||
sag(('[d4rk_divegear] tauchartikel: %d Items in d4rk_item bekannt.'):format(#zeilen))
|
||||
|
||||
for _, it in ipairs(liste()) do
|
||||
local sollExport = it.patrone and EXPORT or nil
|
||||
@@ -155,9 +155,9 @@ RegisterCommand('tauchartikel', function(source, args)
|
||||
local passt = tonumber(z.consume) == 0 and istExport == sollExport
|
||||
|
||||
if passt then
|
||||
print((' %-20s vorhanden, passt'):format(it.name))
|
||||
sag((' %-20s vorhanden, passt'):format(it.name))
|
||||
elseif not nachziehen then
|
||||
print((' %-20s ^3vorhanden, consume %s / Export %s - soll 0 / %s: tauchartikel nachziehen^7')
|
||||
sag((' %-20s ^3vorhanden, consume %s / Export %s - soll 0 / %s: tauchartikel nachziehen^7')
|
||||
:format(it.name, tostring(z.consume), tostring(istExport), tostring(sollExport)))
|
||||
else
|
||||
local w = {}
|
||||
@@ -168,7 +168,7 @@ RegisterCommand('tauchartikel', function(source, args)
|
||||
|
||||
local okU, erfolg, grund = pcall(function() return exports[ITEMS]:adminItemUpdate(0, z.id, w) end)
|
||||
|
||||
print((' %-20s %s'):format(it.name,
|
||||
sag((' %-20s %s'):format(it.name,
|
||||
(okU and erfolg == true) and '^2nachgezogen (consume 0)^7'
|
||||
or ('^1FEHLER: %s^7'):format(okU and tostring(grund) or tostring(erfolg))))
|
||||
end
|
||||
@@ -187,16 +187,16 @@ RegisterCommand('tauchartikel', function(source, args)
|
||||
|
||||
local okC, erfolg, grund = pcall(function() return exports[ITEMS]:adminItemCreate(0, werte) end)
|
||||
|
||||
print((' %-20s %s'):format(it.name,
|
||||
sag((' %-20s %s'):format(it.name,
|
||||
(okC and erfolg == true) and '^2angelegt^7'
|
||||
or ('^1FEHLER: %s^7'):format(okC and tostring(grund) or tostring(erfolg))))
|
||||
end
|
||||
end
|
||||
|
||||
kleidungAnlegen()
|
||||
end, true)
|
||||
end)
|
||||
--[[
|
||||
/tauchstand <id> - WAS LIEGT IN DEN SLOTS? (29.09.2026, nur Serverkonsole)
|
||||
/tauchstand <id> - WAS LIEGT IN DEN SLOTS? (29.09.2026; seit 07.10.2026 auch Admins im Spiel, F8)
|
||||
|
||||
Betreiber: "nachdem er durchgelaufen ist sagt er du traegst keine
|
||||
taucherflasche". getWorn (server/main.lua) liest rigSlot und maskSlot -
|
||||
@@ -204,23 +204,22 @@ end, true)
|
||||
Patrone. Ein `clothing` mit der richtigen Kennung heisst: vor dem
|
||||
/tauchartikel-Eintrag gekauft, die Optik stimmt, das Item nicht.
|
||||
]]
|
||||
RegisterCommand('tauchstand', function(source, args)
|
||||
if source ~= 0 then return end
|
||||
Diagnosebefehl('tauchstand', { restricted = 'group.admin' }, function(source, args)
|
||||
|
||||
local ziel = tonumber(args[1])
|
||||
|
||||
if not ziel or not GetPlayerName(ziel) then
|
||||
print('[d4rk_divegear] tauchstand <server-id> - Spieler nicht gefunden.')
|
||||
sag('[d4rk_divegear] tauchstand <server-id> - Spieler nicht gefunden.')
|
||||
return
|
||||
end
|
||||
|
||||
print(('[d4rk_divegear] tauchstand %d:'):format(ziel))
|
||||
sag(('[d4rk_divegear] tauchstand %d:'):format(ziel))
|
||||
|
||||
for _, s in ipairs({ { 'Flasche', shared.rigSlot, shared.rigItem }, { 'Maske', shared.maskSlot, shared.maskItem } }) do
|
||||
local slot = exports.d4rk_inventory:GetSlot(ziel, s[2])
|
||||
local m = slot and slot.metadata or {}
|
||||
|
||||
print((' %-8s Slot %d: %s (soll %s) garment %s patrone %s oxygen %s'):format(s[1], s[2],
|
||||
sag((' %-8s Slot %d: %s (soll %s) garment %s patrone %s oxygen %s'):format(s[1], s[2],
|
||||
slot and slot.name or '<leer>', s[3], tostring(m.garment), tostring(m.patrone), tostring(m.oxygen)))
|
||||
end
|
||||
end, true)
|
||||
end)
|
||||
Reference in new issue
Block a user