pawn Код:
//relogio
new Text:HorasTxT;
new Text:DataTxT;
DataTxT = TextDrawCreate(620.0,5.0,"00 de 00");
TextDrawUseBox(DataTxT, 0);
TextDrawFont(DataTxT, 3);
TextDrawSetShadow(DataTxT,0);
TextDrawSetOutline(DataTxT,2);
TextDrawBackgroundColor(DataTxT,0x000000FF);
TextDrawColor(DataTxT,0xFFFFFFFF);
TextDrawAlignment(DataTxT,3);
TextDrawLetterSize(DataTxT,0.5,1.5);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HorasTxT = TextDrawCreate(632.0,25.0,"--:--:--");
TextDrawUseBox(HorasTxT, 0);
TextDrawFont(HorasTxT, 3);
TextDrawSetShadow(HorasTxT,0);
TextDrawSetOutline(HorasTxT,2);
TextDrawBackgroundColor(HorasTxT,0x000000FF);
TextDrawColor(HorasTxT,0xFFFFFFFF);
TextDrawAlignment(HorasTxT,3);
TextDrawLetterSize(HorasTxT,0.5,1.5);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetTimer("hora",1000,1);
Mute[playerid] = 0;
TextDrawHideForPlayer(playerid, DataTxT);
TextDrawHideForPlayer(playerid, HorasTxT);
public Usoudroga()
{
minu++;
if(horas==0){
SetWorldTime(0);
}
if(minu>=60){
minu=0;
horas++;
SetWorldTime(horas);
}
if(horas>26){
horas = 0;
}
new string[256];
new hour1;
new minuto;
gettime(hour1,minuto);
if (minu <= 11){format(string,26,"%d:%d",hour1,minuto);}
else {format(string,26,"%d:%d",hour1,minuto);}
public hora(playerid)
{
new str[128],
str2[128],
year,
month,
day,
hour,
minute,
second;
getdate(year,month,day);
gettime(hour,minute,second);
new mes[12];
if(month == 1) { mes = "Janeiro"; }
else if(month == 2) {mes = "Fevereiro";}
else if(month == 3) {mes = "Marзo";}
else if(month == 4) {mes = "Abril";}
else if(month == 5) {mes = "Maio";}
else if(month == 6) {mes = "Junho";}
else if(month == 7) {mes = "Julho";}
else if(month == 8) {mes = "Agosto";}
else if(month == 9) {mes = "Setembro";}
else if(month == 10) {mes = "Outubro";}
else if(month == 11) {mes = "Novembro";}
else if(month == 12) {mes= "Dezembro";}
format(str, sizeof(str), "%d de %s", day, mes,year);
TextDrawSetString(Text:DataTxT, str);
format(str2, sizeof(str2), "%d:%d:%d", hour, minute, second);
TextDrawSetString(Text:HorasTxT, str2);
}