Files
red-valley/_find_broken.py
Kotzu 978c9bc759 fix(qb-core): add global CreateUsableItem alias for qs-inventory compatibility
qs-inventory apelează CreateUsableItem ca funcție globală, dar qb-core definea doar QBCore.Functions.CreateUseableItem (cu 'e'). Adăugat alias global + fix 16 stringuri sparte în items.lua care blocau parsarea.
2026-04-02 00:08:19 +03:00

25 lines
761 B
Python

import re
path = r'E:\FiveMserver\server\resources\[framework]\[core]\qb-core\shared\items.lua'
with open(path, 'r', encoding='utf-8', errors='ignore') as f:
lines = f.readlines()
broken = []
for i, line in enumerate(lines):
stripped = line.strip()
if "['description']" not in stripped:
continue
if "['name']" not in stripped:
continue
# Count single quotes after ['description']
idx = stripped.index("['description']")
after = stripped[idx:]
# Should end with ...'}, or ...'}},
# Check if description value has matching quotes
if after.count("'") % 2 != 0:
broken.append((i+1, stripped[:120]))
print(f"Found {len(broken)} broken strings:")
for ln, txt in broken:
print(f" L{ln}: {txt}")