function main()
repeat wait(0) until isSampAvailable()
while true do
wait(0)
if isKeyJustPressed(ид кнопки) and not sampIsDialogActive() then
sampSetChatInputEnabled(true)
sampSetChatInputTextWithDelay('/time', 250)
end
end
end
function sampSetChatInputTextWithDelay(text, delay)
local array = {}
for i in text:gmatch('[^%z]') do
wait(delay)
table.insert(array, i)
sampSetChatInputText(table.concat(array))
end
end