[Ajuda] Bug contado
#5

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Parei de ler quando me deparei com isso:

Код:
	gindex=0;
	while (gSeconds > 9)
	{
		gSeconds-=10;
		gindex++;
	}

 	format(tmp,10,"%d:%d%d",gMinutes,gindex,gSeconds);
	TextDrawSetString(Ttime, tmp);
A lуgica й de cada um, mas isso foi completamente desotimizado!

Segue o modo otimizado:
Код:
public updateTime(playerid)
{
	new Time2, timestamp;
	new tmp[10];
	
	timestamp = GetTickCount();
	if (gRaceStart != 0)
		Time2 = timestamp - gRaceStart;
	else
		Time2=5;

	new MSeconds;
	timeconvert(Time2, gMinutes, gSeconds, MSeconds);
	
 	format(tmp,10,"%2d:%2d",gMinutes,gSeconds);
	
	TextDrawSetString(Ttime, tmp);
}
P.S.: Isso provavelmente nгo irб corrigir este problema, mas vai dar up nesta callback!
Quote:
Originally Posted by Marllun
Посмотреть сообщение
vlw mano melhorou muito o sistema sу que nгo resolveu eu acho que й isso olhar.

public OnGameModeInit()
{
SetTimer("updateTime",1000,1);
return 1;
}
Parei de ler quando vн a palavra "otimizado" seguidamente da funзгo GetTickCount.





--


Por favor, poste a funзгo timeconvert .
Reply


Messages In This Thread
Bug contado - by Marllun - 17.11.2016, 10:07
Re: [Ajuda]Bug contado - by Marllun - 18.11.2016, 03:19
Re: [Ajuda]Bug contado - by F1N4L - 18.11.2016, 11:45
Re: [Ajuda]Bug contado - by Marllun - 18.11.2016, 19:41
Re: [Ajuda]Bug contado - by zSuYaNw - 18.11.2016, 20:21
Re: [Ajuda]Bug contado - by Marllun - 18.11.2016, 22:30

Forum Jump:


Users browsing this thread: 1 Guest(s)