> For the complete documentation index, see [llms.txt](https://kucluck.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kucluck.gitbook.io/docs/utils/kc-logger/tips.md).

# Tips

### How to get Webhook URL

1. Go to the discord channel you want to get the webhook from and click on the gear image next to the channel name.

<figure><img src="/files/qIQiQxoUFRNf1cPIqmra" alt=""><figcaption></figcaption></figure>

2. Then choose Integrations and select Create Webhooks

<figure><img src="/files/v5FoyKyJv6dtfjtu5DhU" alt=""><figcaption></figcaption></figure>

3. Then click Copy Webhook URL

<figure><img src="/files/8XonW7t5MnOyE7914hX2" alt=""><figcaption></figcaption></figure>

### How To Use Logger

example for leave logger

```lua
function ExtractIdentifiers(id, _type)
  local identifiers = {
    steam = "",
    ip = "",
    discord = "",
    license = "",
    xbl = "",
    live = ""
  }

  for i = 0, GetNumPlayerIdentifiers(id) - 1 do
    local playerID = GetPlayerIdentifier(id, i)
    if string.find(playerID, "steam") then
      identifiers.steam = playerID
    elseif string.find(playerID, "ip") then
      identifiers.ip = playerID
    elseif string.find(playerID, "discord") then
      identifiers.discord = playerID
    elseif string.find(playerID, "license") then
      identifiers.license = playerID
    elseif string.find(playerID, "xbl") then
      identifiers.xbl = playerID
    elseif string.find(playerID, "live") then
      identifiers.live = playerID
    end
  end

  if _type then
    return identifiers[_type]
  else
    return identifiers
  end
end

AddEventHandler("playerDropped", function(reason)
  local src = source
  local identifiers = ExtractIdentifiers(src, false)
  local discordId = identifiers.discord:gsub("discord:", "")
  local coords = GetEntityCoords(GetPlayerPed(src))

  exports['kc_logger']:DiscordLog({
    webhook = Config.PlayerLeave, 
    title = '📤 Leave',
    embeds = '**'..GetPlayerName(src)..'** Baru saja meninggalkan kota.\n**Reason: **`'..reason..'`\n**Coordinat:** `'..coords..'`\n\n`👥` **Nama: '..GetPlayerName(src)..'**\n`🔢` **Server ID:** `'..src..'`\n`💬` **Discord:** <@'..discordId..'> (||'..discordId..'||)\n`🎮` **Steam Hex: **`'..identifiers['steam']..'`',
    color = '#F23A3A'
  })
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://kucluck.gitbook.io/docs/utils/kc-logger/tips.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.
