Jugador Minimizado
#1

Hola,

їAlguno me podrнa decir la manera de detectar a un jugador minimizado?

Gracias, saludos!
Reply
#2

OnPlayerUpdate es ejecutado cada vez que el jugador se actualiza, cuando el jugador estб fuera del juego (alt-tab) OnPlayerUpdate no serб llamado, podйs hacer un script para detectar si pasу 1 segundo desde el ъltimo update para saber si estб alt-tab o no.
Reply
#3

yo usaria algo mas de 1 segundo por el tema del lag Death. podria resultar en un falso positivo
Reply
#4

Ok. Muchas gracias a ambos, ya me di una idea.

Gracias .

PD: Pueden cerrar.
Reply
#5

Quote:
Originally Posted by the_chaoz
Посмотреть сообщение
yo usaria algo mas de 1 segundo por el tema del lag Death. podria resultar en un falso positivo
Si no me equivoco: si estбs quieto (sin pausa) actualizбs cada medio segundo.
Reply
#6

Quote:
Originally Posted by MrDeath
Посмотреть сообщение
OnPlayerUpdate es ejecutado cada vez que el jugador se actualiza, cuando el jugador estб fuera del juego (alt-tab) OnPlayerUpdate no serб llamado, podйs hacer un script para detectar si pasу 1 segundo desde el ъltimo update para saber si estб alt-tab o no.
Ami me interesa como seria, osea seria iniciar un timer de 1 segundo en OnPlayerUpdate, y si el timer no se ivuelve a niciar seria por q esta en pausa?
Reply
#7

Quote:
Originally Posted by Elpiezas
Посмотреть сообщение
Ami me interesa como seria, osea seria iniciar un timer de 1 segundo en OnPlayerUpdate, y si el timer no se ivuelve a niciar seria por q esta en pausa?
pawn Код:
// Top del script
new
    g_iUltimoTickCount[MAX_PLAYERS]
    ;

// OnPlayerUpdate
public OnPlayerUpdate(playerid)
{
    g_iUltimoTickCount[playerid] = GetTickCount();

    return 1;
}

// Funciуn IsPlayerPaused
stock
    IsPlayerPaused(playerid)
    {
        if ((g_iUltimoTickCount[playerid] + 1000) < GetTickCount())
        {
            return 1;
        }

        return 0;
    }
Reply
#8

Yo hice un include de esto:

https://sampforum.blast.hk/showthread.php?tid=186129

Fijate si te sirve.
Reply
#9

insisto en que uses 2 segundos (2000 ms) x el lag.
Reply
#10

їQue lag?

El el timer solamente checkea si estб AFK/Pausado o no.. no hay ningъn lag :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)