Timers en cadena!!
#1

Existes alguna forma que los timer se apaguen en cadena!!! esta haciendo una funcion pero no me salio ya que soy un poco nuevo en esto y quise hacer de esta manera!!

pawn Код:
new Timer2[MAX_PLAYERS];

Timer1[playerid]= SetTimerEx("ServerNombre", 8000, 0, "d", playerid); // en 8000 se apagara
Timer2[playerid] = SetTimerEx("Timer1",10000,true,"i",playerid);  // en 10000 se destruira
KillTimer(Timer2[playerid]);

Quise que primero se apagara que el timer1 y luego de eso se destruiera el timer 2 en secuencia basandose en el timer 1 nose si se pueda hacer eso!!!


saludos
Reply
#2

Hazlo indexado.
Reply
#3

Quote:
Originally Posted by jotajeda
Посмотреть сообщение
Hazlo indexado.
wtf!! y como hago eso.
Reply
#4

Quote:
Originally Posted by Zodiaco
Посмотреть сообщение
wtf!! y como hago eso.
pawn Код:
new Timer[10][MAX_PLAYERS];

Funcion_llamada(playerid)
{
    for(new todos = 0; todos < 10; todos++)
    {
        KillTimer(Timer[todos][playerid]);
    }
    return true;
}
Reply
#5

Pero para quй quieres hacer eso si puedes hacerlo en uno mismo?, o sea, en todo caso serнa mejor ponerle al timer 2 el tiempo del timer uno con false.. pero si quieres hacerlo asн serнa por ejemplo:

pawn Код:
new
    Timer[2] = {-1, ...};

public OnGameModeInit()
{
    Timer[0] = SetTimer("Timer1", 8000, true);
    Timer[1] = SetTimer("Timer2",10000, true);
    return 1;
}

forward Timer1(); public Timer1()
{
    for (new i = 0; i < 2; i++){
        KillTimer(Timer[i]);
    }
    return 1;
}

forward Timer2(); public Timer2()
{
    // Codigo que en este caso no se ejecutara...
    return 1;
}
Reply
#6

Quote:
Originally Posted by Zume-Zero
Посмотреть сообщение
Pero para quй quieres hacer eso si puedes hacerlo en uno mismo?, o sea, en todo caso serнa mejor ponerle al timer 2 el tiempo del timer uno con false.. pero si quieres hacerlo asн serнa por ejemplo:

pawn Код:
new
    Timer[2] = {-1, ...};

public OnGameModeInit()
{
    Timer[0] = SetTimer("Timer1", 8000, true);
    Timer[1] = SetTimer("Timer2",10000, true);
    return 1;
}

forward Timer1(); public Timer1()
{
    for (new i = 0; i < 2; i++){
        KillTimer(Timer[i]);
    }
    return 1;
}

forward Timer2(); public Timer2()
{
    // Codigo que en este caso no se ejecutara...
    return 1;
}
me sale un error de declaracion que, la funcion nunca ha sido usado o algo asi .....aqui ._.

pawn Код:
public OnGameModeInit()
{
    Timer[0] = SetTimer("Timer1", 8000, true);
    Timer[1] = SetTimer("Timer2",10000, true);
    return 1;
}
Reply
#7

http://prntscr.com/5hkd3m
Reply
#8

Quote:
Originally Posted by Zume-Zero
Посмотреть сообщение
ups! lo siento me falta las varibles de abajo de colocar XD gracias ya quedo bien!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)