Installation
Requirements
| Resource | Required |
|---|---|
oxmysql | Yes |
baseevents | Yes |
qbx_core or qb-core | Yes |
ox_inventory or qb-inventory | Yes |
ox_target or qb-target | Yes |
ox_lib | Required on Qbox |
The arrow minigame and placement gizmo are built in. You don't need separate resources for them.
1. Add the resource
Copy the MG-Family folder into your resources directory.
2. Import the database
Import install/install.sql. It creates:
| Table | Stores |
|---|---|
mg_families | Families, level, XP, coins, safe health and upgrades. |
mg_family_members | Members and their roles. |
mg_family_blacklist | Players blocked from a family. |
mg_family_missions | Mafia missions. |
mg_family_mvp | MVP leaderboard. |
3. Add the items
-- 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' },
},-- 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 also uses repairkit. Most inventories already have it; add it only if yours doesn't.
Copy every PNG from install/imgaes/ into your inventory's image folder:
- ox_inventory:
ox_inventory/web/images/ - qb-inventory:
qb-inventory/html/images/
INFO
The image folder really is named imgaes. That's intentional.
4. Start order
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure baseevents
ensure MG-Familyensure oxmysql
ensure qb-core
ensure qb-inventory
ensure qb-target
ensure qb-menu
ensure qb-input
ensure progressbar
ensure baseevents
ensure MG-FamilyDo a full server restart after adding items.
5. Check it works
On startup the console should print the detected systems, for example:
framework=qbx inventory=ox target=ox menu=ox input=oxThen give yourself flaptop and use it. The family laptop should open.
Robbery in the radial menu (optional)
To show a Steal option in qbx_radialmenu during a Safes War, use this check in its config:
local canRob = exports['MG-Family']:CanRobInMatch()When it returns true, trigger the client event family:client:RobPlayer. The server checks everything again before the robbery starts.
