SA-MP Forums Archive
Reaction Test Timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Reaction Test Timer (/showthread.php?tid=190765)



Fixed - NewbBeginner - 16.11.2010

Solved - Thanks


Re: Reaction Test Timer - Grim_ - 16.11.2010

You can use the GetTickCount function to determine the difference from the time the question was asked til the first correct reaction is done (OnReactionWin).


Re: Reaction Test Timer - NewbBeginner - 16.11.2010

Can you give me any example ?
Like how can I bring it up and make it.


Re: Reaction Test Timer - Grim_ - 16.11.2010

pawn Код:
// Near top of script
new count;

// When the question is sent
count = GetTickCount();

// When answered
printf("It took %d to get a right answer!", GetTickCount() - count);
count = 0;



Re: Reaction Test Timer - NewbBeginner - 16.11.2010

And how to make the answer in SECONDS ?


Re: Reaction Test Timer - Grim_ - 16.11.2010

I'm assuming it's returning it in milliseconds? If so, just divide the answer by 1000.
pawn Код:
printf("It took %d second to get a right answer!", ( GetTickCount( ) - count ) / 1000 );



Fixed , Thanks - NewbBeginner - 16.11.2010

Thanks. Problem Solved