06.04.2011, 15:59
(
Последний раз редактировалось LuxurioN™; 06.04.2011 в 22:22.
Причина: OnPlayerDisconnect...
)
- TextDraw
Код:
new Text:DiasS;
Код:
TextDrawShowForPlayer(playerid,DiasS);
Код:
TextDrawHideForPlayer(playerid, DiasS);
Код:
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
Код:
SetTimer("_Dia",5000,1); Edite o periodo do temporizador de preferir.
Код:
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)) ); }