Skip to content

Installation ​

Requirements ​

ResourceRequired
oxmysqlYes
baseeventsYes
qbx_core or qb-coreYes
ox_inventory or qb-inventoryYes
ox_target or qb-targetYes
ox_libRequired 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:

TableStores
mg_familiesFamilies, level, XP, coins, safe health and upgrades.
mg_family_membersMembers and their roles.
mg_family_blacklistPlayers blocked from a family.
mg_family_missionsMafia missions.
mg_family_mvpMVP leaderboard.

3. Add the items ​

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 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 ​

ini
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure baseevents

ensure MG-Family
ini
ensure oxmysql
ensure qb-core
ensure qb-inventory
ensure qb-target
ensure qb-menu
ensure qb-input
ensure progressbar
ensure baseevents

ensure MG-Family

Do 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=ox

Then 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:

lua
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.

All MG Development resources are protected. Redistribution is not permitted.