require 'lib.moonloader'
local text = {'Привет', 'Как дела?'}
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('ans', cmd_ans)
while true do
wait(0)
end
end
function cmd_ans(arg)
id, value = string.match(arg, "(.+) (.+)")
if id == nil or id == '' then
sampAddChatMessage('/ans [id] [value]', -1)
else
sampSendChat('/ans ' .. id .. ' ' .. text[value])
end
end