06.04.2013, 15:14
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;
}
