# Core

{% hint style="warning" %}
Works with G9 scripts. The initialization order must be first.
{% endhint %}

{% tabs %}
{% tab title="cfg.lua" %}

```lua
G9_CORE = {
    framework = nil, -- don't edit
    core = nil, -- don't edit
    lang = 'en', -- for nui languages (en,ar,de etc.)
    inventoryImages = 'nui://qb-inventory/html/images/' -- for nui images
}


function management(job,amount) -- for bossmenu [You need edit here for bank script.]
    if G9_CORE.framework then
        -- for QBCore Example:
        -- exports["savana-bossmenu"]:paidBills(job, math.floor(amount))
    else
        TriggerEvent('esx_addonaccount:getSharedAccount', 'society_' ..job, function(account)
            if job and amount then
                account.addMoney(amount)
            end
        end)
    end
end

if GetResourceState('qb-core') == 'started' then
    G9_CORE.framework = true
    G9_CORE.core = exports['qb-core']:GetCoreObject()
    f = 'QBCore'
elseif GetResourceState('es_extended') == 'started' then
    G9_CORE.framework = false
    G9_CORE.core = exports['es_extended']:getSharedObject()
    f = 'ESX'
end


```

{% endtab %}

{% tab title="client exports" %}

```lua
exports('getPlayerMoney', function()
    return getMoney()
end)

exports('getPlayerName', function()
    return getPlayerName()
end)

exports('pId', function()
    return getPlayerId()
end)

exports('mugShot', function(ped) 
    return GetMugShot(ped)
end)

exports('pJob', function() 
    return getPlayerJob()
end)

exports('setLang', function() 
    return G9_CORE.lang
end)

exports('images', function() 
    return G9_CORE.inventoryImages
end)

exports('getfps', function() 
    return getFps()
end)

```

{% endtab %}

{% tab title="server exports" %}

```lua
exports('player', function(src)
    return getPlayer(src)
end)

exports('enoughMoney', function(id,type,amount)
    return enoughMoney(id,type,amount)
end)

exports('getMoney', function(id)
    return getMoney(id)
end)

exports('addMoney', function(src, type, amount) 
    return addMoney(src,type,amount)
end)

exports('removeMoney', function(src, type, amount)
    return removeMoney(src, type, amount)
end)

exports('playerName', function(identifier,player)
    return playerName(identifier,player)
end)

exports('bankData', function(src)
    return getBankData(src)
end)

exports('cid', function(cid)
    return sGetPlayerFromIdentifier(cid)
end)

exports('society', function(job,amount)
    return addMoneyToSociety(job,amount)
end)

exports('addItem', function(source,items,type)
    return addItem(source,items,type)
end)


```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://gravi9.gitbook.io/documations/scripts/core.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
