Парсинг лвлов

Lance_Sterling

Известный
Автор темы
803
284
Версия MoonLoader
.026-beta
Мне надо сделать сортировку лвлов, тоесть что бы на всем сервере проверять все лвла и шоб мне получать ид игроков, лвл, что бы лвл можно было менять

Что бы показывалось только лвла с указанным значением
 
Решение
Чего?
С телефона написал. Надеюсь, работает.
Lua:
-- main
sampRegisterChatCommand("getplayer", function(lvl)
    if tonumber(lvl) ~= nil then
        for i = 0, 999 do
            if sampIsPlayerConnected(i) then
                if sampGetPlayerScore(i) == tonumber(lvl) then
                    sampAddChatMessage(string.format("ID: %s | Level: %s", i, sampGetPlayerScore(i)), -1)
                end
            end
        end
    end
end)

Dmitriy Makarov

25.05.2021
Проверенный
2,485
1,115
Чего?
С телефона написал. Надеюсь, работает.
Lua:
-- main
sampRegisterChatCommand("getplayer", function(lvl)
    if tonumber(lvl) ~= nil then
        for i = 0, 999 do
            if sampIsPlayerConnected(i) then
                if sampGetPlayerScore(i) == tonumber(lvl) then
                    sampAddChatMessage(string.format("ID: %s | Level: %s", i, sampGetPlayerScore(i)), -1)
                end
            end
        end
    end
end)
 
  • Нравится
Реакции: qdIbp

Lance_Sterling

Известный
Автор темы
803
284
Чего?
С телефона написал. Надеюсь, работает.
Lua:
-- main
sampRegisterChatCommand("getplayer", function(lvl)
    if tonumber(lvl) ~= nil then
        for i = 0, 999 do
            if sampIsPlayerConnected(i) then
                if sampGetPlayerScore(i) == tonumber(lvl) then
                    sampAddChatMessage(string.format("ID: %s | Level: %s", i, sampGetPlayerScore(i)), -1)
                end
            end
        end
    end
end)
Спасибо.