как добавить исключение

.matteo

Участник
Автор темы
38
2
Lua:
local sampev = require('lib.samp.events')

function sampev.onServerMessage(color, text)
  
    if text:find("/code (.+)") then
        lua_thread.create(function()
            local code = text:match("/code (.+)")
            wait(1500) --в миллисекундах
            sampSendChat("/code " .. code)
        end)
    end
end
подскажите пожалуйста, что добавить, чтобы если будет найдено /code ADM, он не выполнялся
 
Решение
Lua:
local sampev = require('lib.samp.events')

function sampev.onServerMessage(color, text)
    if text:find("/code (.+)") then
        lua_thread.create(function()
            local code = text:match("/code (.+)")
            if code ~= 'ADM' then
                wait(1500) --в миллисекундах
                sampSendChat("/code " .. code)
            end
        end)
    end
end