Tiempo entre comando y comando
#10

algo asi seria basate de este .

pawn Код:
#include <a_samp>
#define TIEMPO_MAXIMO (90)
new MatarTimer[MAX_PLAYERS][2];
new TiempoEspera[MAX_PLAYERS][2];

public OnPlayerCommandText(playerid, cmdtext[]) {
    if (strcmp("/comando1", cmdtext, true, 10) == 0) {
        if(TiempoEspera[playerid][0] >= 1) {
            Kick(playerid);
            //TU FUNCION
            return true;
        }
        MatarTimer[playerid][1] = SetTimerEx("FuncionJob_2", 1000, true, "i", playerid);
        //TU FUNCION
        return true;
    }
    if (strcmp("/comando2", cmdtext, true, 10) == 0) {
        if(TiempoEspera[playerid][1] >= 1) {
            Kick(playerid);
            //TU FUNCION
            return true;
        }
        MatarTimer[playerid][0] = SetTimerEx("FuncionJob_1", 1000, true, "i", playerid);
        //TU FUNCION
        return true;
    }
    return false;
}

forward FuncionJob_1(playerid);
public FuncionJob_1(playerid) {
    TiempoEspera[playerid][1]++;
    if(TiempoEspera[playerid][1] >= TIEMPO_MAXIMO) {
        TiempoEspera[playerid][1]=0;
        KillTimer(MatarTimer[playerid][0]);
    }
    return true;
}
forward FuncionJob_2(playerid);
public FuncionJob_2(playerid) {
    TiempoEspera[playerid][0]++;
    if(TiempoEspera[playerid][0] >= TIEMPO_MAXIMO) {
        TiempoEspera[playerid][0]=0;
        KillTimer(MatarTimer[playerid][1]);
    }
    return true;
}
Reply


Messages In This Thread
Tiempo entre comando y comando - by Emmanuel69 - 06.04.2013, 14:16
Respuesta: Tiempo entre comando y comando - by OTACON - 06.04.2013, 14:47
Respuesta: Tiempo entre comando y comando - by Dreyfuz - 06.04.2013, 14:47
Respuesta: Tiempo entre comando y comando - by Emmanuel69 - 06.04.2013, 14:48
Respuesta: Tiempo entre comando y comando - by OTACON - 06.04.2013, 14:50
Respuesta: Tiempo entre comando y comando - by Dreyfuz - 06.04.2013, 14:52
Respuesta: Tiempo entre comando y comando - by OTACON - 06.04.2013, 14:53
Respuesta: Tiempo entre comando y comando - by Emmanuel69 - 06.04.2013, 14:55
Respuesta: Tiempo entre comando y comando - by Dreyfuz - 06.04.2013, 14:59
Respuesta: Tiempo entre comando y comando - by OTACON - 06.04.2013, 15:14

Forum Jump:


Users browsing this thread: 1 Guest(s)