SA-MP Forums Archive
[Ajuda] 660000 contando como 6min - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] 660000 contando como 6min (/showthread.php?tid=369789)



660000 contando como 6min - Since` - 18.08.2012

Olб.

Em meu sistema de up uso um SetTimerEx com 660000 millisegundos, mas, o jogador ganha exp/up a cada 6 minutos, qual й o erro?

Em OnPlayerSpawn
pawn Код:
Timer_UP[playerid] = SetTimerEx("GE", 660000, true, "is", -1, -1);
Public GE

pawn Код:
forward GE(playerid);
public GE(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new s[36];
        format(s, sizeof(s), "Contas/%s.ini", pNick(playerid));

        if(IsPlayerConnected(i))
        {
            if(Experiencia[i] >= 5)
            {
                pLevel[i]++;
                Experiencia[i] = 0;
                TLM[i] = 10;

                SetPlayerScore(playerid, dini_Int(s, "Level"));

                format(strc, sizeof(strc), "| LEVEL | Vocк ganhou +1 level! Level atual: %d", pLevel[i]);
                SendClientMessage(i, CINFO, strc);

                PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);

                dini_IntSet(s, "ExpJogador", Experiencia[i]);
                dini_IntSet(s, "Level", pLevel[i]);

                TeM(playerid);
            }
            else
            {
                Experiencia[i]++;
                TLM[i] = 10;

                format(strc, sizeof(strc), "| EXP | Vocк ganhou +1 ponto de experiencia. (%d/5)", Experiencia[i]);
                SendClientMessage(i, CINFO, strc);

                PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);

                dini_IntSet(s, "ExpJogador", Experiencia[i]);

                TeM(playerid);
            }
        }
    }
    return 1;
}



Re: 660000 contando como 6min - Maklister - 18.08.2012

Troque

pawn Код:
Timer_UP[playerid] = SetTimerEx("GE", 660000, true, "is", -1, -1);
por

pawn Код:
Timer_UP[playerid] = SetTimerEx("GE", 10*360000, true, "is", -1, -1);



Re: 660000 contando como 6min - Kuddy - 18.08.2012

66*60*1000
Minutos / Segundos / Milesimos.


Re: 660000 contando como 6min - DrTHE - 18.08.2012

Troque:
pawn Код:
SetTimerEx("GE", 660000, true, "is", -1, -1);
Por:
pawn Код:
SetTimerEx("GE", 66 * 60 * 1000, true, "d", playerid);



Re: 660000 contando como 6min - paulor - 18.08.2012

pawn Код:
new Timer_UP;

Timer_UP = SetTimer("GE", (11 * 60 * 1000), true);

forward GE();
public GE()
{
    for(new i = (MAX_PLAYERS - 1); i > -1; --i)
    {
        if(IsPlayerConnected(i))
        {
            new s[36];
            format(s, sizeof(s), "Contas/%s.ini", pNick(i));

            if(Experiencia[i] >= 5)
            {
                pLevel[i]++;
                Experiencia[i] = 0;
                TLM[i] = 10;

                SetPlayerScore(i, dini_Int(s, "Level"));

                format(strc, sizeof(strc), "| LEVEL | Vocк ganhou +1 level! Level atual: %d", pLevel[i]);
                SendClientMessage(i, CINFO, strc);

                PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);

                dini_IntSet(s, "ExpJogador", Experiencia[i]);
                dini_IntSet(s, "Level", pLevel[i]);

                TeM(i);
            }
            else
            {
                Experiencia[i]++;
                TLM[i] = 10;

                format(strc, sizeof(strc), "| EXP | Vocк ganhou +1 ponto de experiencia. (%d/5)", Experiencia[i]);
                SendClientMessage(i, CINFO, strc);

                PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);

                dini_IntSet(s, "ExpJogador", Experiencia[i]);

                TeM(i);
            }
        }
    }
    return 1;
}



Re: 660000 contando como 6min - WeenSoares_ - 18.08.2012

pawn Код:
1*60000 = 1 Minuto, aletere o valor 1 para a quantidade de minutos que quiser