التثبيت
المتطلبات
| الريسورس | مطلوب |
|---|---|
oxmysql | نعم |
baseevents | نعم |
qbx_core أو qb-core | نعم |
ox_inventory أو qb-inventory | نعم |
ox_target أو qb-target | نعم |
ox_lib | مطلوب مع Qbox |
لعبة الأسهم وأداة التحريك (gizmo) مدمجة في السكربت، فلا تحتاج ريسورسات منفصلة لها.
1. إضافة السكربت
انسخ مجلد MG-Family إلى مجلد resources.
2. استيراد قاعدة البيانات
استورد install/install.sql. سينشئ هذه الجداول:
| الجدول | يحفظ |
|---|---|
mg_families | العائلات والمستوى و XP والعملات وصحة الخزنة والترقيات. |
mg_family_members | الأعضاء ورتبهم. |
mg_family_blacklist | اللاعبون الممنوعون من العائلة. |
mg_family_missions | مهام المافيا. |
mg_family_mvp | لوحة أفضل لاعب. |
3. إضافة الأيتمات
lua
-- ox_inventory/data/items.lua
['flaptop'] = {
label = 'Family Laptop', weight = 100, stack = false, close = true,
description = 'Opens the family management laptop',
client = { image = 'flaptop.png' },
},
['safescrap'] = {
label = 'Safe Scrap', weight = 100, stack = true, close = true,
description = 'Reinforced scrap used to repair family safes',
client = { image = 'safescrap.png' },
},
['hacking_device'] = {
label = 'Hacking Device', weight = 500, stack = false, close = true,
description = 'Used to hack an enemy family safe',
client = { image = 'hacking_device.png' },
},
['token_global'] = {
label = 'S+ Token', weight = 100, stack = false, close = true,
description = 'Awards family coins when used',
client = { image = 'tokenS.png' },
},
['token_fleeca'] = {
label = 'A Token', weight = 100, stack = false, close = true,
description = 'Awards family coins when used',
client = { image = 'tokenA.png' },
},
['token_cashexchange'] = {
label = 'B Token', weight = 100, stack = false, close = true,
description = 'Awards family coins when used',
client = { image = 'tokenB.png' },
},
['token_laundry'] = {
label = 'C Token', weight = 100, stack = false, close = true,
description = 'Awards family coins when used',
client = { image = 'tokenC.png' },
},
['token_truck'] = {
label = 'D Token', weight = 100, stack = false, close = true,
description = 'Awards family coins when used',
client = { image = 'tokenD.png' },
},
['token_house'] = {
label = 'E Token', weight = 100, stack = false, close = true,
description = 'Awards family coins when used',
client = { image = 'tokenE.png' },
},
['token_store'] = {
label = 'F Token', weight = 100, stack = false, close = true,
description = 'Awards family coins when used',
client = { image = 'tokenF.png' },
},lua
-- qb-core/shared/items.lua
['flaptop'] = { name = 'flaptop', label = 'Family Laptop', weight = 100, type = 'item', image = 'flaptop.png', unique = true, useable = true, shouldClose = true, description = 'Opens the family management laptop' },
['safescrap'] = { name = 'safescrap', label = 'Safe Scrap', weight = 100, type = 'item', image = 'safescrap.png', unique = false, useable = false, shouldClose = true, description = 'Reinforced scrap used to repair family safes' },
['hacking_device'] = { name = 'hacking_device', label = 'Hacking Device', weight = 500, type = 'item', image = 'hacking_device.png', unique = true, useable = false, shouldClose = true, description = 'Used to hack an enemy family safe' },
['token_global'] = { name = 'token_global', label = 'S+ Token', weight = 100, type = 'item', image = 'tokenS.png', unique = true, useable = true, shouldClose = true, description = 'Awards family coins when used' },
['token_fleeca'] = { name = 'token_fleeca', label = 'A Token', weight = 100, type = 'item', image = 'tokenA.png', unique = true, useable = true, shouldClose = true, description = 'Awards family coins when used' },
['token_cashexchange'] = { name = 'token_cashexchange', label = 'B Token', weight = 100, type = 'item', image = 'tokenB.png', unique = true, useable = true, shouldClose = true, description = 'Awards family coins when used' },
['token_laundry'] = { name = 'token_laundry', label = 'C Token', weight = 100, type = 'item', image = 'tokenC.png', unique = true, useable = true, shouldClose = true, description = 'Awards family coins when used' },
['token_truck'] = { name = 'token_truck', label = 'D Token', weight = 100, type = 'item', image = 'tokenD.png', unique = true, useable = true, shouldClose = true, description = 'Awards family coins when used' },
['token_house'] = { name = 'token_house', label = 'E Token', weight = 100, type = 'item', image = 'tokenE.png', unique = true, useable = true, shouldClose = true, description = 'Awards family coins when used' },
['token_store'] = { name = 'token_store', label = 'F Token', weight = 100, type = 'item', image = 'tokenF.png', unique = true, useable = true, shouldClose = true, description = 'Awards family coins when used' },يستخدم MG-Family أيضًا أيتم repairkit. أغلب الإنفنتوريات فيها هذا الأيتم، أضفه فقط إذا لم يكن موجودًا عندك.
انسخ كل صور PNG من install/imgaes/ إلى مجلد صور الإنفنتوري:
- ox_inventory:
ox_inventory/web/images/ - qb-inventory:
qb-inventory/html/images/
INFO
اسم مجلد الصور فعلًا imgaes، وهذا مقصود.
4. ترتيب التشغيل
ini
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure baseevents
ensure MG-Familyini
ensure oxmysql
ensure qb-core
ensure qb-inventory
ensure qb-target
ensure qb-menu
ensure qb-input
ensure progressbar
ensure baseevents
ensure MG-Familyأعد تشغيل السيرفر بالكامل بعد إضافة الأيتمات.
5. التأكد من العمل
عند التشغيل يجب أن يطبع الكونسول الأنظمة التي تم التعرف عليها، مثلًا:
framework=qbx inventory=ox target=ox menu=ox input=oxبعدها أعطِ نفسك flaptop واستخدمه، يجب أن يفتح لابتوب العائلة.
السرقة من القائمة الدائرية (اختياري)
لإظهار خيار Steal في qbx_radialmenu أثناء حرب الخزائن، استخدم هذا التحقق في إعداداته:
lua
local canRob = exports['MG-Family']:CanRobInMatch()عندما يرجع true، شغّل إيفنت الكلاينت family:client:RobPlayer. السيرفر يتحقق من كل شيء مرة أخرى قبل بدء السرقة.
