local screenshot = require 'lib.screenshot'
local active = false
local delay = 50
local filename = 1
function main()
while not isSampAvailable() do wait(0) end
while true do
wait(0)
if wasKeyPressed(49) then
active = not active
sampAddChatMessage(active and 'recording: on' or 'recording: off', -1)
end
if active then
filename = filename + 1
screenshot.requestEx('ti_4mo', tostring(filename))
screenshot.request()
wait(delay)
end
end
end