02.08.2012, 21:00
Quote:
Pon un timer de un segundo, y baja las variables en un valor:
pawn Код:
|
pawn Код:
//OnGameModeInit
SetTimer("Todos", 1000, 1);
//
new Segundos[MAX_PLAYERS],
Minutos[MAX_PLAYERS];
forward Todos();
public Todos()
{
static i;
for(new pid = 0, p_max = GetMaxPlayers(); pid < p_max; pid++) if(IsPlayerConnected(pid))
{
if(Segundos[pid] == 0 && Minutos[pid] == 0) continue;
if(Segundos[pid] == 0 && Minutos[pid] >= 1) Segundos[pid] = 60, Minutos[pid] --;
if(Segundos[pid] >= 1) Segundos[pid]--;
if((i++) == 60)
{
i = 0;
if(Minutos[pid] != 0 && Segundos[pid] != 0) Segundos[pid] = 60;
}
//printf("%d-%d", Minutos[pid], Segundos[pid]);
}
return 1;
}