[Ajuda] Uma contagem apenas pra quem estб no x1.
#1

Jб tentei diversas formas, tudo quanto й por** de jeito, mas nunca saia a contagem certa (sempre pulava os numeros/ia rбpida de mais) e quando funfava, era sу pra um player dentre os dois que estavam no x1... Eu usei loops, atй agora a melhor forma foi com return em cada segundo da contagem ("Count") mas o porйm й que funfava sу pra um nego do x1 =s, veja a callback que й chamada pelo timer :
pawn Код:
public CountDownX1Running()
{

    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(TaNox1Running[i] == 1 && IsPlayerConnected(i))
    {
        if(Count == 5) return GameTextForPlayer(i,"5", 1000, 3), PlayerPlaySound(i, 1056, 0,0,0), Count--;
        if(Count == 4) return GameTextForPlayer(i,"4", 1000, 3), PlayerPlaySound(i, 1056, 0,0,0), Count--;
        if(Count == 3) return GameTextForPlayer(i,"3", 1000, 3), PlayerPlaySound(i, 1056, 0,0,0), Count--;
        if(Count == 2) return GameTextForPlayer(i,"2", 1000, 3), PlayerPlaySound(i, 1056, 0,0,0), Count--;
        if(Count == 1) return GameTextForPlayer(i,"1", 1000, 3), PlayerPlaySound(i, 1056, 0,0,0), Count--;
        if(Count == 0)
        {
            GameTextForPlayer(i,"GO", 2000, 3);
            PlayerPlaySound(i, 1057, 0,0,0);
            KillTimer(CountdownTimerX1Running);
            TogglePlayerControllable(i,1);
        }
    }
    //Count--;
    }

    return 1;
}
desta forma funcionava perfeitamente pra um sу player do x1, mas o outro, sу pegava na hora que acaba a contagem (o "GO") ...

Agradeзo desde jб quem me ajudar
Reply
#2

E Tente..
PHP код:
public CountDownX1Running()
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
TaNox1Running[i] == && IsPlayerConnected(i))
        {
            if(
Count == 5){GameTextForPlayer(i,"5"20003);PlayerPlaySound(i10560,0,0);}
            if(
Count == 4){GameTextForPlayer(i,"4"20003);PlayerPlaySound(i10560,0,0);}
             if(
Count == 3){GameTextForPlayer(i,"3"20003);PlayerPlaySound(i10560,0,0);}
             if(
Count == 2){GameTextForPlayer(i,"2"20003);PlayerPlaySound(i10560,0,0);}
             if(
Count == 1){GameTextForPlayer(i,"1"20003);PlayerPlaySound(i10560,0,0);}
            if(
Count == 0)
            {
                
GameTextForPlayer(i,"GO"20003);
                
PlayerPlaySound(i10570,0,0);
                
KillTimer(CountdownTimerX1Running);
                
TogglePlayerControllable(i,1);
            }
        }
    }
    
Count--;
    return 
true;

Reply
#3

@Off
Voltei agora do curso, malz nгo responder.

@ForT

Funfou, eu jб tinha testado desse jeito, agora que notei que (creio eu), o problema era o "Count--;" !

Obrigado e +REP ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)