16.04.2018, 23:25
Jб testei e jб aproveitei e deixei ele da forma correta que deve ser !
PHP код:
new TimerRelogio[MAX_PLAYERS];
public OnGameModeInit()
{
Textdraw[3] = TextDrawCreate(559.375000, 416.333312, "~w~~h~Data: 00/00/0000 - 00:00:00");
TextDrawLetterSize(Textdraw[3], 0.125000, 1.028332);
TextDrawAlignment(Textdraw[3], 1);
TextDrawColor(Textdraw[3], -1);
TextDrawSetShadow(Textdraw[3], 0);
TextDrawSetOutline(Textdraw[3], 0);
TextDrawBackgroundColor(Textdraw[3], 255);
TextDrawFont(Textdraw[3], 2);
TextDrawSetProportional(Textdraw[3], 1);
TextDrawSetShadow(Textdraw[3], 0);
return 1;
}
public OnPlayerConnect(playerid)
{
TimerRelogio[playerid] = SetTimerEx("Relogio", 1000, true, "d", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, Textdraw[3]);
KillTimer(TimerRelogio[playerid]);
return 1;
}
forward Relogio(playerid);
public Relogio(playerid) {
TextDrawHideForPlayer(playerid, Textdraw[3]);
new string[75], Hora, Minuto, Segundo, Dia, Mes, Ano;
gettime(Hora, Minuto, Segundo);
getdate(Ano, Mes, Dia);
format(string, sizeof(string), "~w~~h~Data: %02d/%02d/%d - %02d:%02d:%02d", Dia, Mes, Ano, Hora, Minuto, Segundo);
TextDrawSetString(Textdraw[3], string);
TextDrawShowForPlayer(playerid, Textdraw[3]);
}