Как сделать привязку по нику через pastebin

FreX

Активный
Автор темы
130
37
Версия MoonLoader
Другое
помогите кто знает как сделать привязку по нику через пастебин список
 
  • Клоун
Реакции: vuyy и XRLM
Решение
Lua:
function main()
    repeat wait(0) until isSampAvailable()
    
    local url = 'https://pastebin.com/raw/12345678'
    local request = require('requests').get(url)
    local nick = sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))
    local function res()
        for n in request.text:gmatch('[^\r\n]+') do
            if nick:find(n) then return true end
        end
        return false
    end
    if not res() then
        sampAddChatMessage('Нет доступа!', -1)
        thisScript():unload()
    else
        -- если ник найден в списке
    end
end

mooh

Известный
157
44
Lua:
function main()
    repeat wait(0) until isSampAvailable()
    
    local url = 'https://pastebin.com/raw/12345678'
    local request = require('requests').get(url)
    local nick = sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))
    local function res()
        for n in request.text:gmatch('[^\r\n]+') do
            if nick:find(n) then return true end
        end
        return false
    end
    if not res() then
        sampAddChatMessage('Нет доступа!', -1)
        thisScript():unload()
    else
        -- если ник найден в списке
    end
end
 
  • Нравится
Реакции: FreX