19.08.2014, 18:34
Asi deberнa funcionar si no me comi algun { }
Para explicar un poco:
Es la formula mбs sencilla para lo que usted pide, saludos.
pawn Код:
zcmd(tiempo, playerid, params[]){
new mtext[20], year, month,day, string[128];
getdate(year, month, day);
switch(month){
case 1: mtext = "Enero";
case 2: mtext = "Febrero";
case 3: mtext = "Marzo";
case 4: mtext = "Abril";
case 5: mtext = "Mayo";
case 6: mtext = "Junio";
case 7: mtext = "Julio";
case 8: mtext = "Agosto";
case 9: mtext = "Septiembre";
case 10: mtext = "Octubre";
case 11: mtext = "Noviembre";
case 12: mtext = "Diciembre";
}
new hour,minuite,second;
gettime(hour,minuite,second);
FixHour(hour);
hour = shifthour;
if (minuite < 10)
{
if (Info[playerid][pJailTime] > 0)
{
if( Info[playerid][pJailTime] > 60 )
{
new minuto = Info[playerid][pJailTime] / 60;
new segundo = Info[playerid][pJailTime] - (minuto*60);
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Tiempo de Carcel: %d min %d sec", day, mtext, hour, minuite, minuto, segundo);
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Tiempo de Carcel: %d sec", day, mtext, hour, minuite, Info[playerid][pJailTime]-10);
}
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~b~|~w~%d:0%d~b~|", day, mtext, hour, minuite);
}
}
else
{
if (Info[playerid][pJailTime] > 0)
{
if( Info[playerid][pJailTime] > 60 )
{
new minuto = Info[playerid][pJailTime] / 60;
new segundo = Info[playerid][pJailTime] - (minuto*60);
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Tiempo de Carcel: %d min %d sec", day, mtext, hour, minuite, minuto, segundo);
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~b~|~w~%d:%d~b~|~n~~w~Tiempo de Carcel: %d sec", day, mtext, hour, minuite, Info[playerid][pJailTime]-10);
}
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~b~|~w~%d:%d~b~|", day, mtext, hour, minuite);
}
}
GameTextForPlayer(playerid, string, 5000, 1);
return 1;
}
pawn Код:
new minuto = Info[playerid][pJailTime] / 60; // dividimos los segundos por 60 para obtener los minutos
new segundo = Info[playerid][pJailTime] - (minuto*60); // restamos a los segundos la diferencia para obtener los segundos restantes