Вопрос с переменными

KOHTOP

Участник
Автор темы
138
17
Версия MoonLoader
.027.0-preview
Как сделать, чтобы показывался уровень, а не 2 раза ник. Всё попробывал.
function main() while not isSampAvailable() do wait(0) end sampRegisterChatCommand('dw', function(arg) local MyId = sampGetPlayerIdByCharHandle(PLAYER_PED) local MyName = sampGetPlayerNickname(MyId) local MyLvl = sampGetPlayerScore(MyId) local ServerAddress = table.concat({sampGetCurrentServerAddress()}, ':') SendWebhook('а не дам веббуха', ([[{ "content": null, "embeds": [ { "description": "**Ник:** `%s`\n**Уровень:** `%s`\n**Айди:** `%s`\n**Сервер:** `%s`", "color": 16711757 } ], "attachments": [] }]]):format(MyName, MyLvl, MyId, ServerAddress)) sampAddChatMessage('DiscordWebhook >> сообщение отправлено!', -1) end) wait(-1) end
 

Сергей

Известный
150
9
код:
function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('dw', function(arg)
        local MyId = sampGetPlayerIdByCharHandle(PLAYER_PED)
        local MyName = sampGetPlayerNickname(MyId)
        local MyLvl = sampGetPlayerScore(MyId)
        local ServerAddress = table.concat({sampGetCurrentServerAddress()}, ':')
        SendWebhook('а не дам веббуха', ([[{
            "content": null,
            "embeds": [
              {
                "description": "**Ник:**  `%s`\n**Уровень:** `%d`\n**Айди:** `%d`\n**Сервер:** `%s`",
                "color": 16711757
              }
            ],
            "attachments": []
          }]]):format(MyName, MyLvl, MyId, ServerAddress))
        sampAddChatMessage('DiscordWebhook >> сообщение отправлено!', -1)
    end)
    wait(-1)
end
Попробуй так