- Версия MoonLoader
- Другое
Как сделать чтоб строчка "sampSendChat(text)" была не в бесконечном цикле
Lua:
require('lib.moonloader')
local _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
local clrs = sampGetPlayerColor(id)
local text = '/clist 0'
local cmd = false
function main()
repeat wait(0) until isSampAvailable()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('cmd', function()
cmd = not cmd
sampAddChatMessage(
cmd and "Включен" or "Выключен", -1)
end)
while true do wait(0)
if cmd then
wait(1500)
if clrs ~= 16777215 and clrs ~= 2854722334 and clrs ~= 2855811128 then
wait(1000)
sampSendChat(text)
end
end
end
end