Как совместить два main

Domino

Участник
Автор темы
326
15
Версия MoonLoader
Lua:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
      while not isSampAvailable() do wait(100) end
      file = io.open('moonloader/AZM/Reports.txt', 'r')
      i = file:read('*a')
      file:close()
                sampRegisterChatCommand("otvet", otvet) -- Вообщем
    wait(-1)
end

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
    apply_custom_style()
  sampRegisterChatCommand("ignor", function()
    main_window_state.v = not main_window_state.v
    -- print(main_window_state.v)
  end)
Как их совместить, чтобы сделать один скрипт
 
Решение
Lua:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    apply_custom_style()
    file = io.open('moonloader/AZM/Reports.txt', 'r')
    i = file:read('*a')
    file:close()
    sampRegisterChatCommand("otvet", otvet)
    sampRegisterChatCommand("ignor", function()
        main_window_state.v = not main_window_state.v
        -- print(main_window_state.v)
    end)
    wait(-1)
end

brabus

Участник
47
14
Lua:
function main()

    if not isSampLoaded() or not isSampfuncsLoaded() then return end

      while not isSampAvailable() do wait(100) end

      file = io.open('moonloader/AZM/Reports.txt', 'r')

      i = file:read('*a')

      file:close()

                sampRegisterChatCommand("otvet", otvet) -- Вообщем

   apply_custom_style()

  sampRegisterChatCommand("ignor", function()

    main_window_state.v = not main_window_state.v

    -- print(main_window_state.v)

end)

end
 

Domino

Участник
Автор темы
326
15
Не работает
Lua:
function main()

    if not isSampLoaded() or not isSampfuncsLoaded() then return end

      while not isSampAvailable() do wait(100) end

      file = io.open('moonloader/AZM/Reports.txt', 'r')

      i = file:read('*a')

      file:close()

                sampRegisterChatCommand("otvet", otvet) -- Вообщем

   apply_custom_style()

  sampRegisterChatCommand("ignor", function()

    main_window_state.v = not main_window_state.v

    -- print(main_window_state.v)

end)

end
 

wulfandr

Известный
636
260
Lua:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    apply_custom_style()
    file = io.open('moonloader/AZM/Reports.txt', 'r')
    i = file:read('*a')
    file:close()
    sampRegisterChatCommand("otvet", otvet)
    sampRegisterChatCommand("ignor", function()
        main_window_state.v = not main_window_state.v
        -- print(main_window_state.v)
    end)
    wait(-1)
end
 

Похожие темы

  1. У
    • Вопрос
    Ответы
    0
    Просмотры
    893
    Помощь
    Удалённый пользователь 187284
    У