Из-за чего ошибка?

Tensay

Активный
Автор темы
169
51
Версия MoonLoader
.026-beta
Из-за чего ошибка?
1649337333523.png



Code:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    local font = renderCreateFont("Arial", 10, 5)
    sampAddChatMessage(tag..'Успешно загружен! Настройка: {ffd500}/sunt', -1)
    sampRegisterChatCommand('sunt', shelper)
    sampRegisterChatCommand('spamm', prospam)
    sampRegisterChatCommand("fm", fm)
    sampRegisterChatCommand("fu", fu)
    sampRegisterChatCommand('nick', nick)
    sampRegisterChatCommand('fmember', members)
    
    downloadUrlToFile(update_url, update_path, function(id, status)
        if status == dlstatus.STATUS_ENDDOWNLOADDATA then
            updateIni = inicfg.load(nil, update_path)
            if tonumber(updateIni.info.vers) > script_vers then
                sampAddChatMessage(tag.. "Обнаружено обновление! Пытаюсь обновиться с версии " .. script_vers_text .. ' на '.. updateIni.info.vers_text, -1)
                update_state = true
            end
            os.remove(update_path)
        end
    end)


    while true do
        wait(0)
        imgui.Process = window.v
        n_result, n_id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    if update_state == true then
       downloadUrlToFile(script_url, script_path, function(id, status)
        if status == dlstatus.STATUS_ENDDOWNLOADDATA then
             sampAddChatMessage(tag.. "Скрипт успешно обновлен!", -1)
             thisScript():reload()
        end
        end)
        break
        end
        if rp_invite.v then
            local result, target = getCharPlayerIsTargeting(playerHandle)
            if result then result, playerid = sampGetPlayerIdByCharHandle(target) end
            if result and isKeyDown(0x5A) then
                name = sampGetPlayerNickname(playerid)
                sampAddChatMessage(tag..'Приглашаю человека в семью...', -1)   
                sampSendChat('/me занес человека в базу данных')
                wait(3000)
                sampSendChat('/finvite '..playerid)
                    wait(250)
            end
        end
        
    end
end
 

sat0ry

Известный
1,089
290
Из-за чего ошибка?
Посмотреть вложение 142529


Code:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    local font = renderCreateFont("Arial", 10, 5)
    sampAddChatMessage(tag..'Успешно загружен! Настройка: {ffd500}/sunt', -1)
    sampRegisterChatCommand('sunt', shelper)
    sampRegisterChatCommand('spamm', prospam)
    sampRegisterChatCommand("fm", fm)
    sampRegisterChatCommand("fu", fu)
    sampRegisterChatCommand('nick', nick)
    sampRegisterChatCommand('fmember', members)
  
    downloadUrlToFile(update_url, update_path, function(id, status)
        if status == dlstatus.STATUS_ENDDOWNLOADDATA then
            updateIni = inicfg.load(nil, update_path)
            if tonumber(updateIni.info.vers) > script_vers then
                sampAddChatMessage(tag.. "Обнаружено обновление! Пытаюсь обновиться с версии " .. script_vers_text .. ' на '.. updateIni.info.vers_text, -1)
                update_state = true
            end
            os.remove(update_path)
        end
    end)


    while true do
        wait(0)
        imgui.Process = window.v
        n_result, n_id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    if update_state == true then
       downloadUrlToFile(script_url, script_path, function(id, status)
        if status == dlstatus.STATUS_ENDDOWNLOADDATA then
             sampAddChatMessage(tag.. "Скрипт успешно обновлен!", -1)
             thisScript():reload()
        end
        end)
        break
        end
        if rp_invite.v then
            local result, target = getCharPlayerIsTargeting(playerHandle)
            if result then result, playerid = sampGetPlayerIdByCharHandle(target) end
            if result and isKeyDown(0x5A) then
                name = sampGetPlayerNickname(playerid)
                sampAddChatMessage(tag..'Приглашаю человека в семью...', -1) 
                sampSendChat('/me занес человека в базу данных')
                wait(3000)
                sampSendChat('/finvite '..playerid)
                    wait(250)
            end
        end
      
    end
end
у тебя переменная updateIni равняется нулю

Из-за чего ошибка?
Посмотреть вложение 142529


Code:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    local font = renderCreateFont("Arial", 10, 5)
    sampAddChatMessage(tag..'Успешно загружен! Настройка: {ffd500}/sunt', -1)
    sampRegisterChatCommand('sunt', shelper)
    sampRegisterChatCommand('spamm', prospam)
    sampRegisterChatCommand("fm", fm)
    sampRegisterChatCommand("fu", fu)
    sampRegisterChatCommand('nick', nick)
    sampRegisterChatCommand('fmember', members)
  
    downloadUrlToFile(update_url, update_path, function(id, status)
        if status == dlstatus.STATUS_ENDDOWNLOADDATA then
            updateIni = inicfg.load(nil, update_path)
            if tonumber(updateIni.info.vers) > script_vers then
                sampAddChatMessage(tag.. "Обнаружено обновление! Пытаюсь обновиться с версии " .. script_vers_text .. ' на '.. updateIni.info.vers_text, -1)
                update_state = true
            end
            os.remove(update_path)
        end
    end)


    while true do
        wait(0)
        imgui.Process = window.v
        n_result, n_id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    if update_state == true then
       downloadUrlToFile(script_url, script_path, function(id, status)
        if status == dlstatus.STATUS_ENDDOWNLOADDATA then
             sampAddChatMessage(tag.. "Скрипт успешно обновлен!", -1)
             thisScript():reload()
        end
        end)
        break
        end
        if rp_invite.v then
            local result, target = getCharPlayerIsTargeting(playerHandle)
            if result then result, playerid = sampGetPlayerIdByCharHandle(target) end
            if result and isKeyDown(0x5A) then
                name = sampGetPlayerNickname(playerid)
                sampAddChatMessage(tag..'Приглашаю человека в семью...', -1) 
                sampSendChat('/me занес человека в базу данных')
                wait(3000)
                sampSendChat('/finvite '..playerid)
                    wait(250)
            end
        end
      
    end
end
lua:
downloadUrlToFile(update_url, update_path, function(id, status)
    if status == dlstatus.STATUS_ENDDOWNLOADDATA then
        local updateIni = inicfg.load(nil, update_path)
        if tonumber(updateIni.info.vers) > script_vers then
            sampAddChatMessage(tag.. "Обнаружено обновление! Пытаюсь обновиться с версии " .. script_vers_text .. ' на '.. updateIni.info.vers_text, -1)
            update_state = true
        end
        os.remove(update_path)
    end
end)

или же запиши вне main()
 
Последнее редактирование: