Ayuda con timer
#1

Hola bueno quisiera saber como hacer para que un timer se inicie cuando el jugador este sobre el checkPoint

Gracias.
Reply
#2

pawn Код:
// creas tu check point
[URL="https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint"]SetPlayerCheckpoint[/URL]

// al entrar en esa check point llamara a OnPlayerEnterCheckpoint

public OnPlayerEnterCheckpoint(playerid)
{
    SetTimer("Conteo", false , 1000);
    return 1;
}

/// luego se activa el timer

forward Conteo();
public Conteo()
{
/// tu Funcion

}
Reply
#3

pawn Код:
new Timer[MAX_PLAYERS];
forward Ejemplo(playerid);

// Luego en la funciуn del checkpoint.
Timer[playerid] = SetTimerEx("Ejemplo", 100, true, "u", playerid);

// Aquн serнa el public llamado por el timer
public Ejemplo(playerid)
{
// Funciones
}
Reply
#4

Quote:
Originally Posted by cesar_******
Посмотреть сообщение
pawn Код:
// creas tu check point
[URL="https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint"]SetPlayerCheckpoint[/URL]

// al entrar en esa check point llamara a OnPlayerEnterCheckpoint

public OnPlayerEnterCheckpoint(playerid)
{
    SetTimer("Conteo", false , 1000);
    return 1;
}

/// luego se activa el timer

forward Conteo();
public Conteo()
{
/// tu Funcion

}
asta ahн llego (gracias) , pero cuбndo salga de el checkpoint seria KillTimer ?

EDITO: los 2 haveis dicho lo mismo pero de diferentes dformas
Reply
#5

pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
    KillTimer( tu time );
    return 1;
}
Reply
#6

Si usas el que te dije yo:

pawn Код:
KillTimer(Timer[playerid]);
Reply
#7

ok Gracias a los 2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)