StopWatch
#1

Hi, To all I seek to create voila a timer to clock the Delta MD-match but I think nothing could you help me thank you, It's kind / brand then go 0.00 and one second by one second and / Stop

Thank you
Reply
#2

I do not understand what you are asking, please try to be a little more clear.
Reply
#3

I look for a chronomйtre for races(shopping) of cars
Reply
#4

SetTimerEx?
Reply
#5

I think he means a stopwatch.

You do /start and it's start going 0.01 - 0.02 ...
And when you do /stop it shows the amount of seconds it took.
Reply
#6

At the top of the script:
Код:
new sec,min,sttimer;
Under OnPlayerCommandText(playerid,cmdtext[])
Starting the count:
Код:
if(!strcmp(cmdtext,"/start",true))
{
	sec = 0;
	min = 0;
	sttimer = SetTimer("stopwatch",1000,1);
	return 1;
}
Stopping code:
Код:
if(!strcmp(cmdtext,"/stop",true))
{
	KillTimer(sttimer);
	new string[256];
	format(string,256,"Time elapsed : %d minutes and %d seconds",min,sec);
	SendClientMessage(playerid,0xffff00aa,string);
	return 1;
}
Anywhere in the script, but outside a callback:
Код:
forward stopwatch();

public stopwatch()
{
	sec++;
	if(sec>59)
	{
		sec = 0;
		min++;
	}
	return 1;
}
It's pretty basic.

I made it quick, so if there is any error, kindly let me know.
Reply
#7

Using GetTickCount(); will give you exact values.
Reply
#8

HO yes Thank You all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)