new texto1[100], year, month, day, hour, minute, second, texto2[100];
getdate(year, month, day);
gettime(hour, minute, second);
format(texto1, sizeof texto1, "Dia: %d/%d/%d", day, month, year);
format(texto2, sizeof texto2, "Hora: %d:%d:%d", hour, minute, second);
Textdraw0 = TextDrawCreate(496.000000, 98.000000, "Torcidas");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.529999, 1.800000);
TextDrawColor(Textdraw0, -16776961);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Textdraw1 = TextDrawCreate(510.000000, 114.000000, "Organizadas");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.500000, 1.500000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
Textdraw2 = TextDrawCreate(499.000000, 133.000000, texto1);
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.529999, 1.400000);
TextDrawColor(Textdraw2, -16776961);
TextDrawSetOutline(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);
Textdraw3 = TextDrawCreate(498.000000, 148.000000, texto2);
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.500000, 1.500000);
TextDrawColor(Textdraw3, -1);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
forward reloginho(playerid);
public reloginho(playerid)
{
new texto1[100], year, month, day, hour, minute, second, texto2[100];
getdate(year, month, day);
gettime(hour, minute, second);
format(texto1, sizeof texto1, "%d/%d/%d", day, month, year);
TextDrawSetString(Textdraw2, texto1);
format(texto2, sizeof texto2, "%d:%d:%d", hour, minute, second);
TextDrawSetString(Textdraw3, texto2);
return 1;
}
forward Atualizar();
public OnGameModeInit()
{
SetTimer("Atualizar", 1 * 1000, true); // 1 Segundo * 1000 milйsimos
return 1;
}
public Atualizar()
{
new texto1[64], year, month, day, hour, minute, second, texto2[64];
getdate(year, month, day);
gettime(hour, minute, second);
format(texto1, sizeof texto1, "Dia: %02d/%02d/%04d", day, month, year);
format(texto2, sizeof texto2, "Hora: %02d:%02d:%02d", hour, minute, second);
SetTextDrawString(Textdraw2, texto1);
SetTextDrawString(Textdraw3, texto2);
return 1;
}
//public OnGameModeInit()
SetTimer("reloginho", 1000, true);
forward reloginho();
public reloginho()
{
new texto1[15], v1, v2, v3;
getdate(v1, v2, v3);
format(texto1, sizeof texto1, "%02d/%02d/%d", v3, v2, v1);
TextDrawSetString(Textdraw2, texto1);
gettime(v1, v2, v3);
format(texto1, sizeof texto1, "%02d:%02d:%02d", v1, v2, v3);
TextDrawSetString(Textdraw3, texto1);
return 1;
}
pawn Код:
|
pawn Код:
@edit Ninja detected ai em cima |
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
return 1;
}
o %02d й sу pra coloca o texto como:
Ex: Agora й 12:01. Se nгo tiver o %02d irб aparecer: 12:1. Se tiver o %02d irб aparecer 12:01. Entгo, este nгo й o erro. Malz, й TextDrawSetString .-. LOL, n deu?? pawn Код:
|