stopwatch [ Please need help! ]
#1

I have a command which starts a stop watch, and checkpoint which stops it. When he stops to a chat writes time. There was a huge need to make so that seconds and milliseconds were considered and removed (that is instead of 20 seconds => 20.16 sec / 20.04 sec / 20.65 sec). Prompt, it is possible such to realize?

PLS HELP!!!! Sorry for my english..

Код:
forward test(playerid);
new timer;
new count = 0;
forward Countdown2(playerid);
new countdown2[MAX_PLAYERS];
Код:
public OnFilterScriptInit()
{
SetTimer("Countdown2",1000,1);
return 1;
}
Код:
if (strcmp("/start", cmdtext, true, 10) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)return SendClientMessage(playerid, 0xFF0000AA,"[INFO]: Вы должны быть в машине");
new Float: X, Float:Y, Float: Z;
GetPlayerPos(playerid, X, Y, Z);
countdown2[playerid]=6;
for(new i=0;i<MAX_PLAYERS;i++)
if(IsPlayerInRangeOfPoint(i,15.0,X,Y,Z))
{
if(GetPlayerState(i) != PLAYER_STATE_ONFOOT && countdown2[i]==-1)countdown2[i]=6;
}
return 1;
}
Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
new str[128];
format(str,sizeof(str),"Время прохождения: %d сек ",count);
SendClientMessage(playerid, 0xFFFFFF, str);}
KillTimer(timer);
return 0;
}
Код:
public test(playerid)
{
    count++;
	count1++; //Use ++ for counting forwards, and -- for counting the seconds backwards
    return 1;
}
Код:
public Countdown2()
{
	for(new i=0;i<MAX_PLAYERS;i++)
	if(IsPlayerConnected(i))
	{
			if(countdown2[i]>0)
			{
				countdown2[i]-=1;
				new str[6];
				format(str,6,"...%d",countdown2[i]);
				GameTextForPlayer(i,str,950,4);
				PlayerPlaySound(i,1056,0.0,0.0,0.0);
				if(countdown2[i]<4)TogglePlayerControllable(i,0);
			}
			if(countdown2[i]==0)
			{
			    TogglePlayerControllable(i,1);
				GameTextForPlayer(i,"~r~GO GO GO",500,4);
				PlayerPlaySound(i,1057,0.0,0.0,0.0);
				SetPlayerRaceCheckpoint(i,1,-431.5638,1409.8419,32.1069,0,0,0,5.0);
				timer = SetTimerEx("test", 1000, 1, "d",i);} 
				countdown2[i]=-1;
			}
	}
}
Reply


Messages In This Thread
stopwatch [ Please need help! ] - by 7emfic - 23.12.2014, 16:53
Re: stopwatch [ Please need help! ] - by 7emfic - 23.12.2014, 17:52
Re: stopwatch [ Please need help! ] - by Schneider - 23.12.2014, 19:00
Re: stopwatch [ Please need help! ] - by 7emfic - 23.12.2014, 19:54

Forum Jump:


Users browsing this thread: 1 Guest(s)