[Ajuda] TextDraw Bug
#9

  • TextDraw
Код:
new Text:DiasS;
OnPlayerConnect:
Код:
TextDrawShowForPlayer(playerid,DiasS);
OnPlayerDisconnect:
Код:
TextDrawHideForPlayer(playerid, DiasS);
OnGameMode(FilterScript)Init:
Код:
DiasS = TextDrawCreate( 496.0,108.0 , "--:--" );
TextDrawBackgroundColor( DiasS, COLOR_YELLOW );
TextDrawFont( DiasS, 1 );
TextDrawLetterSize( DiasS, 0.500000, 1.000000 );
TextDrawColor( DiasS, -1 );
TextDrawSetOutline( DiasS, 0 );
TextDrawUseBox( DiasS, 1 );
TextDrawBoxColor( DiasS,COLOR_BLACK );
TextDrawSetProportional(DiasS, 1 );
TextDrawSetShadow(DiasS, 1 );
  • Funзгo
OnGameMode(FilterScript)Init:
Код:
SetTimer("_Dia",5000,1);
Edite o periodo do temporizador de preferir.
Funзгo:
Код:
forward _Dia(playerid);
public _Dia(playerid)
{
	new 	    
	    D, M, A,
	    Semana,
	    Hoje[ 10 ];
	
	getdate(D,M,A);
	Semana = ChecarDia(D,M,A);
	switch(Semana)
	{
		case 1: Hoje = "Segunda";
		case 2: Hoje = "Terca";
		case 3: Hoje = "Quarta";
		case 4: Hoje = "Quinta";
		case 5: Hoje = "Sexta";
		case 6: Hoje = "Sabado";
		case 7: Hoje = "Domingo";
	}
	return TextDrawSetString(DiasS, Hoje);
}
Код:
Funзгo abaixo criada por Vine e adaptada para 2011 por Drakins:
stock ChecarDia(d,m,y) 
{ 
	m=(m-=2); 
	if(m <= 0) --y,m += 12; 
	return((((d+((13*m-1)/5)+(y%100)+((y%100)/4)+(((y%100)%100)/4)-2*(y%100))%7) == 0) ? (((d+((13*m-1)/5)+(y%100)+((y%100)/4)+(((y%100)%100)/4)-2*(y%100))%7) + 1) : (((d+((13*m-1)/5)+(y%100)+((y%100)/4)+(((y%100)%100)/4)-2*(y%100))%7)) ); 
}
Caso o cуdigo acima nгo funcione, possivelmente o problema vem de um "conflito" entre seu script e outro.
Reply


Messages In This Thread
[Ajuda] TextDraw Bug - by Carl_Thuse - 05.04.2011, 20:35
Re: [Ajuda] TextDraw Bug - by zbt_Daimyo - 05.04.2011, 20:54
Re: [Ajuda] TextDraw Bug - by Carl_Thuse - 05.04.2011, 22:13
Re: [Ajuda] TextDraw Bug - by Chefгo - 05.04.2011, 23:06
Re: [Ajuda] TextDraw Bug - by Carl_Thuse - 05.04.2011, 23:31
Re: [Ajuda] TextDraw Bug - by Chefгo - 05.04.2011, 23:38
Re: [Ajuda] TextDraw Bug - by Chefгo - 05.04.2011, 23:44
Re: [Ajuda] TextDraw Bug - by Chefгo - 06.04.2011, 09:14
Re: [Ajuda] TextDraw Bug - by LuxurioN™ - 06.04.2011, 15:59
Re: [Ajuda] TextDraw Bug - by douglasmonteiro - 13.05.2011, 15:44

Forum Jump:


Users browsing this thread: 1 Guest(s)