как исправить флуд в луа

Stepan_Kolkin

Участник
Автор темы
91
9
Версия SA-MP
  1. 0.3.7 (R1)
тут крипт писал сам но некоторые команды брал из интернета


может какую строчку добавить

Lua:
local times = false
function main()
    if not isSampLoaded() then return end
    sampRegisterChatCommand('test', time)
    while true do
       wait(0)
       if times then
         sampSendChat( '/do ' .. os.date("%X"))
       end
    end
end

function time()
    times = not times
    sampAddChatMessage(times and "вкл" or "выкл", -1)
end
 
Последнее редактирование модератором:
Решение
Lua:
local times = false
function main()
if not isSampLoaded() then return end
sampRegisterChatCommand('test', time)
while true do
wait(0)
if times then
sampSendChat( '/do ' .. os.date("%X"))
end
end
end

function time()
times = not times
sampAddChatMessage(times and "вкл" or "выкл", -1)
end
ты это имел в виду?

если ты делаешь не флудер то:
Код:
local times = false
function main()
if not isSampLoaded() then return end
sampRegisterChatCommand('test', time)
while true do
wait(0)

end
end

function time()
times = not times
sampAddChatMessage(times and "вкл" or "выкл", -1)
    if times then
        sampSendChat('/do '..os.date("%X"))
    end
end
Что за бред

Lua:
sampRegisterChatCommand('test', function() sampSendChat('/do...

Fott

Простреленный
3,441
2,289
Lua:
local times = false
function main()
if not isSampLoaded() then return end
sampRegisterChatCommand('test', time)
while true do
wait(0)
if times then
sampSendChat( '/do ' .. os.date("%X"))
end
end
end

function time()
times = not times
sampAddChatMessage(times and "вкл" or "выкл", -1)
end
ты это имел в виду?

если ты делаешь не флудер то:
Код:
local times = false
function main()
if not isSampLoaded() then return end
sampRegisterChatCommand('test', time)
while true do
wait(0)

end
end

function time()
times = not times
sampAddChatMessage(times and "вкл" or "выкл", -1)
    if times then
        sampSendChat('/do '..os.date("%X"))
    end
end
Что за бред

Lua:
sampRegisterChatCommand('test', function() sampSendChat('/do '..os.date("%X")) end)
 
  • Нравится
Реакции: Stepan_Kolkin