# Full View config.server.lua

{% code fullWidth="true" %}

```lua
SV = {}

SV.Webhooks = {
    ['WITHDRAW'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['REMOVE_MARKETPLACE'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['PLACED_MARKETPLACE'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['CHANGED_NAME'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['CHANGED_DESCRIPTION'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['UPDATED_DISCOUNT'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['UPDATED_PRODUCT_PRICE'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['PUTTED_ITEM'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['PULLED_ITEM'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
    ['BOUGHT_ITEM'] = "https://discord.com/api/webhooks/xxxxxxxxxxxxxx",
}

SV.WebhookText = {
    ['TITLE.WITHDRAW_CASH'] = "💸 WITHDRAW CASH",
    ['DESCRIPTION.WITHDRAW_CASH'] = "Player %s [%s] withdraw %s$ from market with ID %s",

    ['TITLE.REMOVE_MARKETPLACE'] = "❌ REMOVE MARKETPLACE",
    ['DESCRIPTION.REMOVE_MARKETPLACE'] = "Player %s [%s] removed marketplace with ID %s",
    ['DESCRIPTION.REMOVE_MARKETPLACE_ADMIN'] = "Administrator %s [%s] removed marketplace with ID %s",
    
    ['TITLE.PLACED_MARKETPLACE'] = "🏗️ PLACED MARKETPLACE",
    ['DESCRIPTION.PLACED_MARKETPLACE'] = "Player %s [%s] placed marketplace with ID %s\n**TYPE**: %s\n**NAME**: %s\n**DESCRIPTION**: %s\n**COORDS**: %s",
    
    ['TITLE.CHANGED_NAME'] = "⌨️ CHANGED NAME",
    ['DESCRIPTION.CHANGED_NAME'] = "Player %s [%s] changed name from %s to %s on marketplace ID %s",
    
    ['TITLE.CHANGED_DESCRIPTION'] = "⌨️ CHANGED DESCRIPTION",
    ['DESCRIPTION.CHANGED_DESCRIPTION'] = "Player %s [%s] changed description from %s to %s on marketplace ID %s",
    
    ['TITLE.ENABLED_DISCOUNT'] = "🎫 ENABLED DISCOUNT",
    ['DESCRIPTION.ENABLED_DISCOUNT'] = "Player %s [%s] enabled discount -%s on marketplace ID %s",

    ['TITLE.DISABLED_DISCOUNT'] = "🎫 DISABLED DISCOUNT",
    ['DESCRIPTION.DISABLED_DISCOUNT'] = "Player %s [%s] disabled discount on marketplace ID %s",

    ['TITLE.UPDATED_PRODUCT_PRICE'] = "💲 UPDATED PRODUCT PRICE",
    ['DESCRIPTION.UPDATED_PRODUCT_PRICE'] = "Player %s [%s] updated price for item %s from %s$ to %s$ on marketplace ID %s",

    ['TITLE.PUTTED_ITEM'] = "🤲 PUTTED ITEM",
    ['DESCRIPTION.PUTTED_ITEM'] = "Player %s [%s] putted item %s %sx on marketplace ID %s",
    
    ['TITLE.PULLED_ITEM'] = "🫳 PULLED ITEM",
    ['DESCRIPTION.PULLED_ITEM'] = "Player %s [%s] pulled item %s %sx from marketplace ID %s",

    ['TITLE.BOUGHT_ITEM'] = "💰 BOUGHT ITEM",
    ['DESCRIPTION.BOUGHT_ITEM'] = "Player %s [%s] bought item %s %sx from marketplace ID %s",
}

SV.Webhook = function(webhook_id, title, description, color, footer)
    local DiscordWebHook = SV.Webhooks[webhook_id]
    local embeds = {
        {
            ["title"] = title,
            ["type"] = "rich",
            ["description"] = description,
            ["color"] = color,
            ["footer"] = {
                ["text"] = footer..' - '..os.date(),
            },
        }
    }
    PerformHttpRequest(DiscordWebHook, function(err, text, headers) end, 'POST', json.encode({username = name, embeds = embeds}), {['Content-Type'] = 'application/json'})
end

SV.GetInventory = function(xPlayer)
    if Config.Core == "ESX" then
        return xPlayer.getInventory()
    elseif Config.Core == "QB-Core" then
        return xPlayer.PlayerData.items
    end
end

SV.GetItemLabel = function (xPlayer, item)
    if Config.Core == "ESX" then
        return ESX.GetItemLabel(item)
    elseif Config.Core == "QB-Core" then
        return xPlayer.Functions.GetItemByName(item).label
    end
end

SV.CheckCountOfItem = function(xPlayer, item, count)
    if Config.Core == "ESX" then
        return xPlayer.getInventoryItem(item).count >= count
    elseif Config.Core == "QB-Core" then
        return xPlayer.Functions.GetItemByName(item).amount >= count
    end
end

SV.AddInventoryItem = function(xPlayer, item, count)
    if Config.Core == "ESX" then
        xPlayer.addInventoryItem(item, count)
    elseif Config.Core == "QB-Core" then
        xPlayer.Functions.AddItem(item, count)
    end
end

SV.RemoveInventoryItem = function(xPlayer, item, count)
    if Config.Core == "ESX" then
        xPlayer.removeInventoryItem(item, count)
    elseif Config.Core == "QB-Core" then
        xPlayer.Functions.RemoveItem(item, count)
    end
end

if Config.MarketplacesOnItem then
    if Config.Core == "ESX" then
        for k, v in pairs(Config.MarketplaceItems) do
            if k and v then
                ESX.RegisterUsableItem(v.item, function(source)
                    TriggerClientEvent("vms_marketplaces:usedItem", source, k, v.item)
                end)
            end
        end
    elseif Config.Core == "QB-Core" then
        for k, v in pairs(Config.MarketplaceItems) do
            if k and v then
                QBCore.Functions.CreateUseableItem(v.item, function(source, item)
                    TriggerClientEvent("vms_marketplaces:usedItem", source, k, v.item)
                end)
            end
        end
    end
end
```

{% endcode %}


---

# 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://docs.vames-store.com/outdated/vms_marketplaces/configuration/full-view-config.server.lua.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.
