local time_end = '00:00'
local is_clock = true
local bass = require "lib.bass"
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('timer', function(arg)
local hours, minutes = arg:match("(%d%d?):(%d%d?)")
if hours and minutes then
time_end = string.format("%02d:%02d", hours, minutes)
sampAddChatMessage("время напоминания: " .. time_end, -1)
else
sampAddChatMessage('ошибся в вводе браток', -1)
end
end)
while true do
wait(0)
local current_time = os.date('%H:%M')
if current_time == time_end and is_clock then
local radio = bass.BASS_StreamCreateURL("https://clck.ru/3BERdm", 0, 0, nil, nil)
bass.BASS_ChannelSetAttribute(radio, BASS_ATTRIB_VOL, 100)
bass.BASS_ChannelPlay(radio, false)
is_clock = false
end
if current_time ~= time_end then
is_clock = true
end
end
end