Posts: 4,930
Threads: 467
Joined: Dec 2010
pawn Код:
public Clock(playerid)
{
new string2[256];
new hour, minute;
gettime(hour,minute);
if(hour == 23) hour = 11;
format(string2, sizeof(string2), "%d:%d", hour, minute);//second);
TextDrawSetString(reloj[playerid], string2);
}
Posts: 2,041
Threads: 97
Joined: Jun 2013
Quote:
Originally Posted by OTACON
pawn Код:
public Clock(playerid) { new string2[256]; new hour, minute; gettime(hour,minute); if(hour == 23) hour = 11; format(string2, sizeof(string2), "%d:%d", hour, minute);//second); TextDrawSetString(reloj[playerid], string2); }
|
En realidad:
pawn Код:
public Clock(playerid)
{
new string2[256];
new hour, minute;
gettime(hour,minute);
switch(hour)
{
case 13: hour = 1;
case 14: hour = 2;
case 15: hour = 3;
case 16: hour = 4;
case 17: hour = 5;
case 18: hour = 6;
case 19: hour = 7;
case 20: hour = 8;
case 21: hour = 9;
case 22: hour = 10;
case 23: hour = 11;
case 24: hour = 0;
}
format(string2, sizeof(string2), "%d:%d", hour, minute);//second);
TextDrawSetString(reloj[playerid], string2);
return 1;
}
Corrнgeme si me equivoco.
Posts: 4,930
Threads: 467
Joined: Dec 2010
Quote:
Originally Posted by EnzoMetlc
En realidad:
pawn Код:
public Clock(playerid) { new string2[256]; new hour, minute; gettime(hour,minute); switch(hour) { case 13: hour = 1; case 14: hour = 2; case 15: hour = 3; case 16: hour = 4; case 17: hour = 5; case 18: hour = 6; case 19: hour = 7; case 20: hour = 8; case 21: hour = 9; case 22: hour = 10; case 23: hour = 11; case 24: hour = 12; } format(string2, sizeof(string2), "%d:%d", hour, minute);//second); TextDrawSetString(reloj[playerid], string2); return 1; }
Corrнgeme si me equivoco. 
|
pero ..
case 24: hour = 12; O_O? 24 no existe en el reloj, es 0 = 12

.
PD: y por ke me citaste a mi, yo le di un ejemplo de lo ke el pidio para ke se base ¬¬.
Posts: 2,041
Threads: 97
Joined: Jun 2013
Quote:
Originally Posted by OTACON
pero .. case 24: hour = 12; O_O? 24 no existe en el reloj, es 0 = 12  .
PD: y por ke me citaste a mi, yo le di un ejemplo de lo ke el pidio para ke se base ¬¬.
|
No sabнa eso de la hora '24', gracias.
Te citй a tн, por que sabнa si el cуdigo que puse estaba bien jaja.
Saludos.