Что тут не так? :D

chapo

tg/inst: @moujeek
Автор темы
Всефорумный модератор
9,234
12,647
Версия MoonLoader
.026-beta
Lua:
require "lib.moonloader"
function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  while true do
  sampRegisterChatCommand('ssssss', main)
  if main then
    wait(0)
      sampSendChat("1")
    wait 1200
      sampSendChat("2")
    wait 1200
      sampSendChat("3")
    wait 1200
      sampSendChat("4")
    wait 1200
      sampSendChat("5")
    wait 1200
      sampSendChat("6")
    wait 1200
      sampSendChat("7")
    wait 1200
      sampSendChat("8") 
    wait 1200
      sampSendChat("9")   
    end
  end
  end
 

paulohardy

Известный
Всефорумный модератор
1,997
1,339
Lua:
require "lib.moonloader"
function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  while true do
  sampRegisterChatCommand('ssssss', main)
  if main then
    wait(0)
      sampSendChat("1")
    wait 1200
      sampSendChat("2")
    wait 1200
      sampSendChat("3")
    wait 1200
      sampSendChat("4")
    wait 1200
      sampSendChat("5")
    wait 1200
      sampSendChat("6")
    wait 1200
      sampSendChat("7")
    wait 1200
      sampSendChat("8")
    wait 1200
      sampSendChat("9")
    end
  end
  end
wait(1200), регистрация команды в бесконечном цикле, не задана функция, которую вызывает команда
Lua:
require "lib.moonloader"
function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand('ssssss', function() main = not main end)
  while true do
  wait(0)
  if main then
      sampSendChat("1")
    wait(1200)
      sampSendChat("2")
    wait(1200)
      sampSendChat("3")
    wait(1200)
      sampSendChat("4")
    wait(1200)
      sampSendChat("5")
    wait(1200)
      sampSendChat("6")
    wait(1200)
      sampSendChat("7")
    wait(1200)
      sampSendChat("8")
    wait(1200)
      sampSendChat("9")   
    end
  end
  end
 
  • Нравится
Реакции: chapo

Dmitriy Makarov

25.05.2021
Проверенный
2,512
1,139
Lua:
require "lib.moonloader"
function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand("sss", test)
  wait(-1)
end

function test()
lua_thread.create(function()
sampSendChat("1")
wait(1000)
sampSendChat("2")
wait(1000)
sampSendChat("3")
wait(1000)
sampSendChat("4")
wait(1000)
end)
end
 
Последнее редактирование:
  • Нравится
Реакции: chapo