- Версия MoonLoader
- .026-beta
Я пытаюсь добавить подождать поток вне основной функции, но сценарий не работает. пожалуйста помоги.
не знаю как правильно добавить lua_thread
не знаю как правильно добавить lua_thread
Код:
local q = require 'lib.samp.events'
function main()
if not isSampLoaded() and isSampAvailable() then return end
while not isSampAvailable() do wait(0) end
sampAddChatMessage("{F8F9F9}(Activation command is /cartimer)")
sampRegisterChatCommand("cartimer", cmd)
wait(-1)
end
function cmd()
Activate = not Activate
sampAddChatMessage(string.format("{F8F9F9}Sell car timer is %s", Activate))
end
function q.onServerMessage(c, s)
lua_thread.create(function() <---
if string.find("your reload time is 12 minutes") and Activate == true then
wait(720000)
printStringNow('you can sell car again', 5000)
end)
end