function main()
local delay = 1000
sampRegisterChatCommand('setdelay', function(arg)
if arg:match('%d+') then
delay = tonumber(arg)
sampAddChatMessage('new delay = '..delay, -1)
else
sampAddChatMessage('incorrect delay', -1)
end
end)
sampRegisterChatCommand('startnum', function()
active = not active
sampAddChatMessage(active and 'on' or 'off', -1)
end)
while true do wait(delay)
if active then
math.randomseed(os.time()^3.14)
printStyledString(math.random(0,1), delay, 4)
end
end
end