Documentation
  • Discord Server
  • About Us
  • Free Resources
    • Death Screen
      • PS-Dispatch Integration
    • Battlepass
      • Guides
      • Commands
        • Player Commands
        • Admin Commands
      • API
        • Server
    • Garages
      • Guides
        • Creating Interior
        • Creating Garage
        • How to find entity sets (customizations) for interior
  • Paid Resources
    • Elevator Creator V2
      • Installation
      • Accessible code
    • Radar System V2
      • Installation
      • Accessible code
    • Hotels Creator
      • Accessible code
    • Vehicle Shop Creator
      • Accessible code
    • Stocks Market
      • Accessible code
      • [DEV] - Usable Functions
    • Discord Voice Attendance
      • Installation
    • Deathmatch System
      • Installation
        • esx_ambulancejob
        • qb-ambulancejob
        • wasabi_ambulance
        • qbx_medical
        • codem-inventory
        • core_inventory
      • Accessible code
    • Object Creator
      • Dependencies
      • Accessible code
    • Cocaine Labs
      • Dependencies
      • Accessible code
    • Ownable Crafting Tables
      • Dependencies
      • Accessible code
      • Common Problems
    • Evidence System
      • Dependencies
      • Accessible code
      • Installation
      • API
    • Marketplace V2
      • Accessible code
      • Installation
      • Migration from V1
    • EMS Dispatch
      • Sending Dispatch
      • Accessing the Menu
      • Config File
    • Weed Planting
      • Accessible code
      • How to add new strain?
      • How to install
    • Advanced DarkNet System
      • Config
    • Advanced Taxi Job
      • Accessible code
      • Changelog
    • Advanced Gang Creator
      • Accessible code
      • Installation
        • QB Core
        • QBOX Core
      • API
      • FAQ
    • Advanced Private Cameras
      • ESX
        • Items
      • QBCore
        • Items
      • Accessible code
    • Advanced Elevator Creator
      • Accessible code
    • Advanced Ownable Rent Creator
      • SQL
      • ESX
      • QBCore
      • Config File
    • Advanced Job Creator
      • Installation
        • QB CORE
      • Accessible code
    • Advanced Ownable Shops
      • Installation
      • Accessible code
      • SQL
    • Advanced Ped Creator
      • SQL
      • Config File
    • Advanced Promocode Creator
      • Accessible code
      • SQL File
      • Common problems
    • Advanced Safe Zone Creator
      • Config File
    • Turf Wars
      • Ox Inventory
      • Accessible code
      • API
    • Advanced Gas Station Creator
      • Accessible code
    • Advanced Advertisements System
      • SQL File
      • Accessible code
    • Player Manager
      • Installation
      • Accessible code
    • Mechanic Job
      • Installation
      • Accessible code
      • SQL
    • Advanced Radar System
      • Accessible code
      • SQL
    • Crypto Mining
      • Installation
      • Accessible code
      • Items
      • SQL
    • Racing System
      • Accessible code
    • Car Theft
      • Accessible code
    • Advanced Solar Panels
      • Accessible Code
      • SQL
      • ESX
        • Items
      • QBCore
        • Items
    • Pilot Job
      • Accessible Code
      • ESX
        • SQL
      • QBCore
        • Metadata
        • qb-smallresources
      • QBOX
        • Metadata
    • Advanced Ownable Banks
      • Accessible Code
    • Post Office
      • Accessible Code
      • ESX
        • SQL
      • QBCore
        • SQL
      • Exports
    • Weather Sync
      • API
    • Billing System
      • Accessible code
      • SQL
      • Common problems
Powered by GitBook
On this page
  1. Paid Resources
  2. Advanced Gang Creator

Accessible code

Config = {
    FrameworkName = IsESX() and 'es_extended' or 'qb-core',
    Locale = 'en',

    Events = {
        esx = {
            client = {
                loaded = 'esx:playerLoaded',
                logout = 'esx:onPlayerLogout',
                setjob = 'esx:setJob'
            },

            server = {
                loaded = 'esx:playerLoaded',
                logout = 'esx:playerLogout'
            }
        },
        qb = {
            client = {
                loaded = 'QBCore:Client:OnPlayerLoaded',
                logout = 'QBCore:Client:OnPlayerUnload',
                setplayerdata = 'QBCore:Player:SetPlayerData',
                gangupdate = 'QBCore:Client:OnGangUpdate'
            }
        }
    },

    enableWardrobe = true,              -- enables function for opening wardrobe, in client/editable.lua in OpenWardrobe function put your event

    disableIntegratedVehicles = false,  -- option for disabling integrated vehicles

    -- players only can be searched if you cuff them first
    SearchOnlyWhenCuffed = true,

    -- disable moving while cuffed?
    freezeWhileCuffed = true,
 
    -- ESX ONLY

    --SetGangAs = 'job',            -- will set gang as job
    --SetGangAs = 'job2',           -- will set gang as job2
    --SetGangAs = 'metadata',       -- will set gang on our system and work from there leaving your job or job2 free to use

    SetGangAs = 'metadata',

    InventoryPrefix = 'inventory',      -- this is only for qs inv, this prefix must be same as in inventory config 

    -- cuff, uncuff, put in vehicle on target script?
    MafiaActionsOnTarget = false,

    TargetOptions = {
        search = true,
        cuff = true,
        escort = true,
        putin = true,
        takeout = true
    },

    mafiaMenu = {                       -- f6 action menu position, available positions: 'top-left' or 'top-right' or 'bottom-left' or 'bottom-right'
        defaultKey = 'F6',              -- key for opening menu
        position = 'top-right',
        enabled = true,                 -- if you dont want it put false
    },

    commands = {
        creator = {
            name = 'creategang',       -- command for creating mafia
            restricted = 'group.admin', -- grop that will have acces to command 
        },

        deleteMafia = {
            name = 'deletegang',         -- command for deleting mafia, /dellmafia mafia
            restricted = 'group.admin'  -- group that will have acces to command 
        },

        teleportToBase = {
            name = 'tpbase',            -- command for teleporting to mafia, /tpbase mafia
            restricted = 'group.admin'  -- group that will have acces to command 
        },

        findBase = {
            name = 'findbase',          -- command for players to find their base via gps
            enabled = true              -- by puting here false you disable this command
        },

        resetMarker = {
            name = 'resetmarker',       -- command for reseting all markers to 1 again
            restricted = 'group.admin'  -- group that will have acces to command 
        },

        updateCars = {
            name = 'updatevehicles',    -- command for updating integrated vehicles in mafia
            restricted = 'group.admin'  -- group that will have acces to command 
        },

        newMarker = {
            name = 'newmarker',         -- command for adding more markers
            restricted = 'group.admin', -- group that will have acces to command 
        },


        setGang = {
            name = 'uisetgang',           -- command for setting gang
            restricted = 'group.admin'    -- group that will have acces to command 
        },
        
        -- esx only and if you use SetGangAs as metadata
        removeGang = {
            name = 'removegang',
            restricted = 'group.admin',
        },

        -- esx only and if you use SetGangAs as metadata
        mygang = {
            name = 'mygang',
            restricted = 'group.admin'
        }
    },

    -- if set to true everybody at server who has password can acces stash
    stashAccessEveryone = false, -- if set to false only people who has job can access that stash, again if they have password


    stash = {
        [1] = {10, 10},     -- [level] = {slots, kg}
        [2] = {20, 20},     -- [level] = {slots, kg}
        [3] = {30, 30},     -- [level] = {slots, kg}
        [4] = {40, 40},     -- [level] = {slots, kg}
        [5] = {50, 50},     -- [level] = {slots, kg}
        [6] = {60, 60},     -- [level] = {slots, kg}
        [7] = {70, 70},     -- [level] = {slots, kg}
        [8] = {80, 80},     -- [level] = {slots, kg}
        [9] = {90, 90},     -- [level] = {slots, kg}
        [10] = {100, 100},  -- [level] = {slots, kg}
    },

    Levels = {               -- prices for levels
        [1] = 500,           -- price for level 2 
        [2] = 1000,          -- price for level 3
        [3] = 1500,          -- price for level 4
        [4] = 2000,          -- price for level 4 
        [5] = 2500,          -- price for level 4 
        [6] = 3000,          -- price for level 4 
        [7] = 3500,          -- price for level 4
        [8] = 4000,          -- price for level 4 
        [9] = 4500,          -- price for level 4 
        [10] = 5000,         -- price for level 4 
    },

    firePlayerData = {
        qb = {
            job = 'none',
            grade = 0
        },

        -- if your SetGangAs is metadata then this isnt important
        esx = {
            job = 'unemployed',
            grade = 0,
        }
    },

    TuneOptions = {
        modEngine = 3,
        modBrakes = 2,
        modTransmission = 2,
        modSuspension = 3,
        modArmor = true,
        windowTint = 1,
    
        -- other possibilities you can find here: https://overextended.dev/ox_lib/Modules/VehicleProperties/Client#vehicle-properties
        -- if you dont know how to setup this properly, open ticket at our discord
    },

    dealership = {                                                  -- only mafia can see blip and open dealership
        enable = true,                                              -- if you dont want this option put false here, ALSO DISABLES OWNED VEHICLES GARAGE
        blip = {
            type = 227,                                             -- https://docs.fivem.net/docs/game-references/blips/
            scale = 0.6,
            colour = 3,                                             -- https://docs.fivem.net/docs/game-references/blips/#blip-colors
            text = 'Illegal Dealership'
        },
        coords = vec3(499.257, -1338.011, 29.319),                  -- coords for marker, blip
        vehiclePreview = vec4(493.756, -1332.161, 28.336, 252.884),
        unitCalculator = 'kmh'                                      -- or 'mph', this is for calculating vehicle max speed
    },

    -- only mafia can see blip and interact
    impound = {
        blip = {
            type = 227,     -- https://docs.fivem.net/docs/game-references/blips/
            scale = 0.6,
            colour = 1,     -- https://docs.fivem.net/docs/game-references/blips/#blip-colors
            text = 'Illegal Impound'
        },
        coords = vec3(-465.680, -1707.112, 18.811), -- marker
        spawn = vec3(-456.535, -1706.918, 18.819),  -- coords where vehicle spawns after purchasing

    },

    ImpoundPrices = {
        -- These are vehicle classes
        [0] = 300,      -- Compacts
        [1] = 500,      -- Sedans
        [2] = 500,      -- SUVs
        [3] = 800,      -- Coupes
        [4] = 1200,     -- Muscle
        [5] = 800,      -- Sports Classics
        [6] = 1500,     -- Sports
        [7] = 2500,     -- Super
        [8] = 300,      -- Motorcycles
        [9] = 500,      -- Off-road
        [10] = 1000,    -- Industrial
        [11] = 500,     -- Utility
        [12] = 600,     -- Vans
        [13] = 100,     -- Cylces
        [14] = 2800,    -- Boats
        [15] = 3500,    -- Helicopters
        [16] = 3800,    -- Planes
        [17] = 500,     -- Service
        [18] = 0,       -- Emergency
        [19] = 100,     -- Military
        [20] = 1500,    -- Commercial
        [21] = 0        -- Trains (lol)
    },

    Payout = {
        enabled = true,         -- if you have in es_extended config Config.EnableSocietyPayouts = false then put this to false, otherwise people will get payout in this script and and via es_extended, if you use SetGangAs = 'metadata' then this doesnt apply, same applies to qb core
        payFromBalance = true,  -- should people get salary from gang balance?,
        interval = 7 * 60000    -- how often to recieve pay checks in milliseconds, (7min)
    }
}
Discord = {

    url = '',  -- url here

    title = 'Server Name',

    /*
        https://www.spycolor.com/

        ['default'] = 14423100,
        ['blue'] = 255,
        ['red'] = 16711680,
        ['green'] = 65280,
        ['white'] = 16777215,
        ['black'] = 0,
        ['orange'] = 16744192,
        ['yellow'] = 16776960,
        ['pink'] = 16761035,
        ['lightgreen'] = 65309,
    */

    color = 65309, -- green

    imageUrl = 'https://cdn.discordapp.com/attachments/1126197898439295066/1129791542379434004/discord_banner_uniq.png', -- optional, if you dont want it put ''


    TagEveryoneFields = {               -- here you can handle which log should/or not tag @everyone
        mafiaCreating = false,          -- when mafia is created by admin
        levelUp = false,                -- when players level up their mafia 
        firePeopleOnline = false,       -- when players fires people from mafia that are online
        firePeopleOffline = false,      -- when players fires people from mafia that are offline
        firePeopleCheater = true,       -- when somebody tries to fire people from mafia without boss grade
        hire = false,                   -- when boss hires new people
        hireCheater = true,             -- when somebody that doesnt have boss grade tries to hire via cheat
        eventCheck = true  ,            -- when tries to execute event via executor
        updateGradeCheater = true,      -- when somebody tries to update grade for players that doesnt have boss
        updateGradeOnline = false,      -- when grade is updated for players
        moneyWithdraw = false,          -- when money is withdrawn from mafia
        moneyDeposit = false,           -- when money is deposited in mafia
        vehicleBuy = false,             -- vehicle buying
        deleteVehicles = false,         -- when admin deletes integrated vehicle from mafia
        newVehicle = false,             -- when new vehicle is added by admin
        updateBoss = false,             -- when boss menu marker is updated via command
        vehicleMarker = false,          -- when vehicle marker is updated via command
        heliMarker = false,             -- when helicopter marker is updated via command
        lvl = false,                    -- when level marker is updated via command
        stashUpdate = false,            -- when stash position is updated via command
    }
}
Vehicles = {
    ['sport'] = {
        {label = 'sport', values = {
            {label = 'Adder', model = `adder`, price = 1000, description = '', level = 55 },
            {label = 'Zentorno', model = `zentorno`, price = 2000, description = '', level = 1 },
            {label = 'T20', model = `t20`, price = 3000, description = '', level = 1 },
        }}
    },

    ['coupes'] = {
        {label = 'coupes', values = {
            {label = 'Felon', model = `Felon`, price = 1000, description = '', level = 1 },
            {label = 'FelonB', model = `felon2`, price = 2000, description = '', level = 1 },
            {label = 'Oracle', model = `Oracle`, price = 3000, description = '', level = 1 },
        }}
    },

    ['offroads'] = {
        {label = 'offroads', values = {
            {label = 'Bfinjection', model = `bfinjection`, price = 1000, description = '', level = 1 },
            {label = 'Bifta', model = `bifta`, price = 2000, description = '', level = 1 },
            {label = 'Bodhi', model = `bodhi2`, price = 3000, description = '', level = 1 },
        }}
    },
}
function sendNotify(title, description, type)
    lib.notify({
        title = title,
        description = description,
        duration = 4500,
        type = type,
        position = 'bottom'
    })
end


RegisterNetEvent('uniq_mafia:notify', sendNotify)


local illenium = GetResourceState('illenium-appearance'):find('start')
function OpenWardrobe()
    if illenium then
        TriggerEvent('illenium-appearance:client:openOutfitMenu')
    end
end

function OpenNearbyPlayerInventory(id)
    if id then
        if Inv.ox then
            Inv.exp:openInventory('player', id)
        elseif Inv.qb then
            TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", id)
        end
    end
end

function OpenGangStash(id, job)
    if Inv.ox then
        Inv.exp:openInventory('stash', id)
    elseif Inv.qs then
        TriggerServerEvent(Config.InventoryPrefix..":server:OpenInventory", "stash", id, {
            maxweight = Config.stash[Mafia[job].level][2] * 1000,
            slots = Config.stash[Mafia[job].level][1],
        })
        TriggerEvent(Config.InventoryPrefix..":client:SetCurrentStash", id)
    elseif Inv.qb then
        TriggerServerEvent("inventory:server:OpenInventory", "stash", id, {
            maxweight = Config.stash[Mafia[job].level][2] * 1000,
            slots = Config.stash[Mafia[job].level][1],
        })
        TriggerEvent("inventory:client:SetCurrentStash", id)
    elseif Inv.core then
        TriggerServerEvent('core_inventory:server:openInventory', id, 'stash')
    elseif Inv.codem then
        TriggerServerEvent('codem-inventory:server:openstash', id, Config.stash[Mafia[job].level][1], Config.stash[Mafia[job].level][2], '')
    end
end


local qskeys = GetResourceState('qs-vehiclekeys'):find('start')
local wasabikeys = GetResourceState('wasabi_carlock'):find('start')
local qbkeys = GetResourceState('wasabi_carlock'):find('start')

function GiveCarKeys(plate)
    if qskeys then
        exports['qs-vehiclekeys']:GiveKeysAuto()
    elseif wasabikeys then
        exports.wasabi_carlock:GiveKey(plate)
    elseif qbkeys then
        TriggerEvent('qb-vehiclekeys:client:AddKeys', plate)
    end
end


function RemoveCarKeys(plate)
    if qskeys then
        local model = GetDisplayNameFromVehicleModel(GetEntityModel(cache.vehicle))
        exports['qs-vehiclekeys']:RemoveKeys(plate, model)
    elseif wasabikeys then
        exports.wasabi_carlock:RemoveKey(plate)
    elseif qbkeys then
        TriggerEvent('qb-vehiclekeys:client:RemoveKeys', plate)
    end
end
if IsQBCore() then
    local qbox = GetResourceState('qbx_core'):find('start')
    local qbcore = GetResourceState('qb-core'):find('start')

    function InsertGang(label, name, grades)
        if qbox then
            local gang = {}
            local newValue, newGrades = {}, {}

            for k,v in pairs(grades) do
                newValue[#newValue+1] = { id = tonumber(k), data = v }
            end

            table.sort(newValue, function(a, b)
                return a.id < b.id
            end)

            for k,v in pairs(newValue) do
                newGrades[v.id] = v.data
            end

            gang[name] = {
                label = label,
                grades = newGrades,
            }

            return exports['qbx_core']:CreateGangs(gang)
        elseif qbcore then
            local gang = {
                label = label,
                grades = grades
            }

            return QBCore.Functions.AddGang(name, gang)
        end
    end

    function SetGang(source, name, grade)
        if qbox then
            QBCore.Functions.GetPlayer(source)?.Functions.SetGang(name, tonumber(grade))
        elseif qbcore then
            QBCore.Functions.GetPlayer(source)?.Functions.SetGang(name, tostring(grade))
        end
    end
end


function GiveSalary(source, salary)
    if IsESX() then
        ESX.GetPlayerFromId(source)?.addAccountMoney('bank', salary, 'Paycheck')
    elseif IsQBCore() then
        QBCore.Functions.GetPlayer(source)?.Functions.AddMoney('cash', salary, 'Paycheck')
    end
end


function RegisterGangStash(id, label, level)
    if Inv.ox then
        Inv.exp:RegisterStash(id, label, Config.stash[tonumber(level)][1], Config.stash[tonumber(level)][2] * 1000, false)
    elseif Inv.qs then
        Inv.exp:RegisterStash('', id, Config.stash[tonumber(level)][1], Config.stash[tonumber(level)][2])
    end
end
PreviousAdvanced Gang CreatorNextInstallation

Last updated 11 months ago