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.
25 lines
761 B
Python
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}")
|