> For the complete documentation index, see [llms.txt](https://docs.ak4y.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ak4y.com/scripts/ak4y-map_editor-v2/editable-files/serverconfig.lua.md).

# serverConfig.lua

````lua
WEBHOOK = "ENTER WEBHOOK"

function SendLog(playerId, action, message)
    local src = playerId
    local playerName = GetPlayerName(src)
    local playerCoords = GetEntityCoords(GetPlayerPed(src))

    local identifiers = {
        steam = "None",
        license = "None",
        discord = "None",
        ip = "None",
        xbl = "None",
        live = "None",
        fivem = "None"
    }

    for _, id in pairs(GetPlayerIdentifiers(src)) do
        if string.find(id, "steam:") then
            identifiers.steam = id
        elseif string.find(id, "license:") then
            identifiers.license = id
        elseif string.find(id, "discord:") then
            identifiers.discord = id:gsub("discord:", "")
        elseif string.find(id, "ip:") then
            identifiers.ip = id:gsub("ip:", "")
        elseif string.find(id, "xbl:") then
            identifiers.xbl = id
        elseif string.find(id, "live:") then
            identifiers.live = id
        elseif string.find(id, "fivem:") then
            identifiers.fivem = id
        end
    end

    local licenseInfo = table.concat({
        identifiers.license and (identifiers.license) or nil,
        identifiers.steam and (identifiers.steam) or nil,
        identifiers.discord and (identifiers.discord) or nil,
        identifiers.ip and (identifiers.ip) or nil,
        identifiers.fivem and (identifiers.fivem) or nil,
        identifiers.xbl and (identifiers.xbl) or nil,
        identifiers.live and (identifiers.live) or nil,
    }, "\n")

    local embed = {
        ["color"] = 373247,
        ["fields"] = {
            {
                ["name"] = action,
                ["value"] = "",
                ["inline"] = false
            },
            {
                ["name"] = "Player Name",
                ["value"] = playerName,
                ["inline"] = true
            },
            {
                ["name"] = "Player ID",
                ["value"] = src,
                ["inline"] = true
            },
            {
                ["name"] = "Action Details",
                ["value"] = message,
                ["inline"] = false
            },
            {
                ["name"] = "License Information",
                ["value"] = licenseInfo ~= "" and "```" .. licenseInfo .. "```" or "No information found",
                ["inline"] = false
            }
        }
    }

    sendWebhook(WEBHOOK, {embed})
end

function sendWebhook(webhook, data)
	PerformHttpRequest(webhook, function() end, 'POST', json.encode({ username = 'AK4Y LOGS', embeds = data}), { ['Content-Type'] = 'application/json' })
end

````


---

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

```
GET https://docs.ak4y.com/scripts/ak4y-map_editor-v2/editable-files/serverconfig.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.
