Nesesito ayuda con estй comando
#2

Asi deberнa funcionar si no me comi algun { }
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;
    }
Para explicar un poco:
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
Es la formula mбs sencilla para lo que usted pide, saludos.
Reply


Messages In This Thread
Nesesito ayuda con estй comando - by Metzone - 19.08.2014, 16:20
Re: Nesesito ayuda con estй comando - by LeonardoEscobar - 19.08.2014, 18:34

Forum Jump:


Users browsing this thread: 1 Guest(s)