new Clock[200];
Textdraw[3] = TextDrawCreate(559.375000, 416.333312, Clock);
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);
public Relogio(playerid)
{
new string[2500];
format(string, sizeof string, "~w~~h~Data: %d/%s%d/%d - %s%d:%s%d:%s%d", ClockTime[dDay], ((ClockTime[dMonth] < 10) ? ("0") : ("")), ClockTime[dMonth], RELOGIO_ANO, (ClockTime[tHour] < 10) ? ("0") : (""), ClockTime[tHour], (ClockTime[tMinute] < 10) ? ("0") : (""), ClockTime[tMinute], (ClockTime[tSecond] < 10) ? ("0") : (""), ClockTime[tSecond]);
TextDrawSetString(Textdraw[3], string);
}
public Relogio(playerid) { format(Clock, 35, "~w~~h~Data: %02d/%02d/%d - %02d:%02d:%02d", ClockTime[dDay], ((ClockTime[dMonth] < 10) ? ("0") : ("")), ClockTime[dMonth], RELOGIO_ANO, (ClockTime[tHour] < 10) ? ("0") : (""), ClockTime[tHour], (ClockTime[tMinute] < 10) ? ("0") : (""), ClockTime[tMinute], (ClockTime[tSecond] < 10) ? ("0") : (""), ClockTime[tSecond]); TextDrawSetString(Textdraw[3], Clock); return true; }
public Relogio(playerid) { new Dia, Mes, Ano, Hora, Minutos, Segundos ; getdate(Dia, Mes, Ano), gettime(Hora, Minutos, Segundos); format(Clock, 35, "~w~~h~Data: %02d/%02d/%d - %02d:%02d:%02d", Dia, Mes, Ano, Hora, Minutos, Segundos); TextDrawSetString(Textdraw[3], Clock); return true; }
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]);
}
Jб testei e jб aproveitei e deixei ele da forma correta que deve ser !
PHP код:
|
C:\Users\Lan\Desktop\Gangs Brasil\gamemodes\Gangs.pwn(22715) : warning 219: local variable "Hora" shadows a variable at a preceding level
C:\Users\Lan\Desktop\Gangs Brasil\gamemodes\Gangs.pwn(22715) : warning 219: local variable "Minuto" shadows a variable at a preceding level
C:\Users\Lan\Desktop\Gangs Brasil\gamemodes\Gangs.pwn(22715) : warning 219: local variable "Dia" shadows a variable at a preceding level
C:\Users\Lan\Desktop\Gangs Brasil\gamemodes\Gangs.pwn(22715) : warning 219: local variable "Mes" shadows a variable at a preceding level
C:\Users\Lan\Desktop\Gangs Brasil\gamemodes\Gangs.pwn(22715) : warning 219: local variable "Ano" shadows a variable at a preceding level
new string[75], Hora, Minuto, Segundo, Dia, Mes, Ano;
Deu essas warnings
PHP код:
PHP код:
|
new string[75];
public OnPlayerConnect(playerid)
{
TimerRelogio[playerid] = SetTimerEx("Relogio", 1000, true, "d", playerid);
TextDrawShowForPlayer(playerid, Textdraw[3]);
return 1;
}
public Relogio(playerid) {
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);
}
bom aqui nгo ficou mas tente fazer isto:
PHP код:
PHP код:
|
forward Relogio(playerid);
public Relogio(playerid)
{
new string[75], Segundo;
format(string, sizeof(string), "~w~~h~Data: %02d/%02d/%d - %02d:%02d:%02d", Dia, Mes, Ano, Hora, Minuto, Segundo);
TextDrawSetString(Textdraw[3], string);
}