require "lib.moonloader"
require "lib.sampfuncs"
local ev = require 'lib.samp.events'
function main()
while not isSampAvailable do wait(100) end
active = 2
sampRegisterChatCommand("ot", activatecmd)
while true do
wait(1)
end
end
function ev.onServerMessage(color, text)
if active == 1 then
if text:find("Привет") then
sampSendChat("Привет")
return {color, text}
active = 2
end
end
end
function activatecmd()
if active == 2 then
active = 1
sampAddChatMessage("Скрипт {00FF00}включен", -1)
else
active = 2
sampAddChatMessage("Скрипт {FF0000}выключен", -1)
end
end