> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_tattoos/integrations/qbgangs.md).

# qb-gangs

If you are using the new QB gangs functions, you can easily integrate it to our job restricted tattoos.

1. open the file `rcore_tattoos\client\api\helper.lua`
2. Replace whole `isPlayerJobMatching` function with the code below
3. Add gang name and gang grades same way as adding job permission to tattoo (check **How to** below)

### `isPlayerJobMatching` with gangs:

```lua
function isPlayerJobMatching(tattooJobs, playerJob)
    if not playerJob or not playerJob.name then
        dbg.info('isPlayerJobMatching: playerJob not passed!')
        return false
    end

    -- qb-gangs
    local pData
    local gangName = nil
    local gangGrade = nil

    if QBCore then
        pData = QBCore.Functions.GetPlayerData() or nil
    end

    if pData and pData.gang then
        gangName = pData.gang.name or nil

        if pData.gang.grade ~= nil then
            gangGrade = pData.gang.grade.level or nil
        end
    end
    -----------

    for _, tattooJob in pairs(tattooJobs) do
        if not tattooJob.name then
            dbg.error('isPlayerJobMatching: Missing job name in tattoo permissions config!')
            break
        end

        if tattooJob.name == playerJob.name then
            if playerJob.grade == nil and tattooJob.grade == nil then
                return true
            end
            
            if tattooJob.grade == nil then
                return true
            end

            if playerJob.grade ~= nil and playerJob.grade >= tattooJob.grade then
                return true
            end
        elseif tattooJob.name == gangName then
            if gangGrade == nil and tattooJob.grade == nil then
                return true
            end
            
            if tattooJob.grade == nil then
                return true
            end

            if gangGrade ~= nil and gangGrade >= tattooJob.grade then
                return true
            end
        end
    end
end
```

### **How to add to tattoo**

You can add it the same way, as when you are adding job restriction to tattoo.

{% hint style="danger" %}
Don't name it 'gangs'! Keep the name 'jobs' as if you were adding normal job!
{% endhint %}

```lua
"permissions": {
    "jobs": [ -- it will still be called jobs, not gangs!
        {
            "name": "bloods", -- gang name
            "grade": 1 -- minimal gang grade to show the tattoo - not required
        },  
    ],
},
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.rcore.cz/paid-resources/rcore_tattoos/integrations/qbgangs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
