21.03.2012, 23:39
Retirei um de um gamemode meu.
pawn Код:
forward AtualizarRelogio(playerid);
new Text:Hora;
public OnGameModeInit()
{
SetTimer("AtualizarRelogio",1000,1);
Hora = TextDrawCreate(545.000000, 37.000000, "_");
TextDrawBackgroundColor(Hora, 255);
TextDrawFont(Hora, 1);
TextDrawLetterSize(Hora, 0.469999, 1.900000);
TextDrawColor(Hora, -1);
TextDrawSetOutline(Hora, 1);
TextDrawSetProportional(Hora, 1);
return true;
}
public AtualizarRelogio(playerid)
{
new str[128],
hour,
minute,
second;
gettime(hour,minute,second);
format(str, sizeof(str), "%d:%d:%d", hour, minute, second);
TextDrawSetString(Hora, str);
TextDrawShowForPlayer(playerid, Hora);
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Hora);
return true;
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, Hora);
return true;
}