--[[ d4rk_divegear - /tauchprobe: welche Kleidung ist die Tauchmaske? (plan-divegear.md Schritt 0, 28.09.2026) Flasche und Maske werden Kleidungsstuecke aus dem Kleiderladen (d4rk_garment). Dafuer braucht es Komponente, Sammlung und lokalen Index - je Modell (m/f). Der Katalog hat keine Namen, also wird gemessen: SetPedScubaGearVariation (0x36C6984C3ED0C911, PED, client) setzt laut Nativ-Datenbank bei Freemode-Modellen die Tauchmaske. Diese Probe liest ALLE Komponenten (0-11) und Props (0-7) vorher und nachher und nennt, was sich geaendert hat - samt Sammlung, lokalem Index und Zahl der Texturen. GEGENPROBE: aendert sich gar nichts, steht "UNGUELTIG" da - das Native hat dann nichts getan, und "keine Maske" waere die falsche Lesart. DIE FLASCHE setzt das Native bei Freemode NICHT (laut Doku nur bei player_*-Modellen). Nachgeschlagen, nicht gemessen: maennlich Komponente 8, Drawable 123. Deshalb liest die Probe mit "flasche [n]" Komponente 8 bei Drawable n (Vorgabe 123) - ob es die Flasche IST, sieht nur das Auge. Zurueck zur eigenen Kleidung: /d4rk_anziehen (d4rk_inventory). ]] local function modell(ped) local m = GetEntityModel(ped) if m == `mp_m_freemode_01` then return 'm' end if m == `mp_f_freemode_01` then return 'f' end return '?' end local function stand(ped) local t = {} for c = 0, 11 do t['c' .. c] = { art = 'c', id = c, d = GetPedDrawableVariation(ped, c), tex = GetPedTextureVariation(ped, c), sammlung = GetPedDrawableVariationCollectionName(ped, c) or 'base', lokal = GetPedDrawableVariationCollectionLocalIndex(ped, c), } end for p = 0, 7 do t['p' .. p] = { art = 'p', id = p, d = GetPedPropIndex(ped, p), tex = GetPedPropTextureIndex(ped, p), sammlung = GetPedPropCollectionName(ped, p) or 'base', lokal = GetPedPropCollectionLocalIndex(ped, p), } end return t end local function zeile(ped, e) local texturen = e.art == 'c' and GetNumberOfPedTextureVariations(ped, e.id, e.d) or (e.d >= 0 and GetNumberOfPedPropTextureVariations(ped, e.id, e.d) or 0) return ('%s%-2d global %4d Textur %2d Sammlung %-14s lokal %4d Texturen %d'):format( e.art, e.id, e.d, e.tex, tostring(e.sammlung ~= '' and e.sammlung or 'base'), e.lokal or -1, texturen or -1) end RegisterCommand('tauchprobe', function(_, args) local ped = PlayerPedId() print('') print(('^5=== d4rk_divegear: Tauchprobe (Modell %s) ===^7'):format(modell(ped))) if args[1] == 'flasche' then local n = tonumber(args[2]) or 123 SetPedComponentVariation(ped, 8, n, 0, 0) Wait(300) local s = stand(ped).c8 print(' Komponente 8 gesetzt auf global ' .. n .. ':') print(' ' .. zeile(ped, s)) print((' Ist das die Taucherflasche? Ansehen. Andere Nummer: /tauchprobe flasche . ' .. 'Zurueck: /d4rk_anziehen')) return end local vorher = stand(ped) SetPedScubaGearVariation(ped) Wait(500) local nachher = stand(ped) local anders = 0 for k, n in pairs(nachher) do local v = vorher[k] if v.d ~= n.d or v.tex ~= n.tex then anders = anders + 1 print(' vorher ' .. zeile(ped, v)) print(' nachher ' .. zeile(ped, n)) end end if anders == 0 then print('^1 UNGUELTIG: SetPedScubaGearVariation hat nichts geaendert - keine Aussage.^7') else print(('^2 %d Teil(e) geaendert.^7 Zurueck zur eigenen Kleidung: /d4rk_anziehen'):format(anders)) end lib.notify({ title = 'Tauchprobe', description = 'Ergebnis in F8.', type = 'info' }) end, false)