CODE:external(INT, "wsprintf", "wsprintfA", "User32.dll" );
int t1, t2;
int timeout = 120; // 120 секунд (2 минуты)
t1=gettime()/1000; t2=t1;
enabletimer(0);
loop()sleep(100);
function SecondsToNormalTime(int Seconds)
{
char c[1024];
int Min=Seconds/60, Sec=Seconds-Min*60;
wsprintf(address(#c[0]), "%02d:%02d", Min, Sec);
return format(#c[0]);
}
CREATE_TIMER(0, 100)
{
if(timeout > -1)
{
textout(0, 0, 0, SecondsToNormalTime(timeout), 1);
t1=gettime()/1000;
if(t1!=t2){t1=gettime()/1000; t2=t1; timeout--;}
}
} |