Comando /jail.
#1

Hola, queria pedir el comando jail con las variables : Informacion[playa][ICarcel] , Informacion[playa][ITiempo].

PD : yo se crearlo pero nose como restarle el tiempo cada segundo/minuto.
Reply
#2

Pon un timer de un segundo, y baja las variables en un valor:

pawn Код:
//OnGameModeInit
SetTimer("Todos", 1000, 1);
//
forward Todos();
public Todos()
{
    for(new playa = 0; playa < GetMaxPlayers(); playa++)
        Informacion[playa][ICarcel] --;
    return 1;
}
Reply
#3

Quote:
Originally Posted by Bu11Sh0t
Посмотреть сообщение
Pon un timer de un segundo, y baja las variables en un valor:

pawn Код:
//OnGameModeInit
SetTimer("Todos", 1000, 1);
//
forward Todos();
public Todos()
{

    for(new playa = 0; playa < GetMaxPlayers(); playa++)
        Informacion[playa][ICarcel] --;
    return 1;
}
Este decrece los minutos y no nada mas los segundos
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;
}
Reply
#4

Quote:
Originally Posted by Jovanny
Посмотреть сообщение
Este decrece los minutos y no nada mas los segundos
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;
}
no entiendo el codigo, aver si me lo podrias explicar un poco, yo quiero que cada minuto reste 1 a esta enum : Informacion[playa][ITiempo];

aver si lo podrias hacer, gracias.
Reply
#5

Son minutos nada mas o tambien tienes la variable de segundos ?
Reply
#6

Quote:
Originally Posted by Jovanny
Посмотреть сообщение
Son minutos nada mas o tambien tienes la variable de segundos ?
puedes hacer una funcion para que cada minuto reste -1 a Infomacion[Playa][ITiempo], gracias.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)