How to check if the player in ESC(Menu)
#1

Title...
Thanks for helpers.
Reply
#2

Mate,

It was already added in 0.3x.

Well, Use this:- http://pastebin.com/hEvJb7FX
Reply
#3

Quote:
Originally Posted by Bingo
Посмотреть сообщение
Mate,

It was already added in 0.3x.

Well, Use this:- http://pastebin.com/hEvJb7FX
It's not in the wiki, or in the release thread, are you sure that's not an include? It's also not in the a_samp.inc.

This will work for you though.

https://sampforum.blast.hk/showthread.php?tid=281590
Reply
#4

Clue: OnPlayerUpdate isn't called while a player is viewing the pause menu.

Quote:
Originally Posted by Bingo
Посмотреть сообщение
Mate,
It was already added in 0.3x.
No it wasn't.
Quote:
Originally Posted by Bingo
Посмотреть сообщение
That code is useless without the 'paused' include which is not included in the link you gave.
Reply
#5

pawn Код:
new bool:PlayerPaused[MAX_PLAYERS] = false,
InactiveTime[MAX_PLAYERS];

public OnGameModeInit()
{
    SetTimer("CheckForPausedPlayers", 1000, true);
    return 1;
}

public OnPlayerUpdate(playerid)
{  
    if(InactiveTime[playerid] >= 5) PlayerPaused[playerid] = false; // Player has unpaused their game.
    InactiveTime[playerid] = 0;
    return 1;
}

forward CheckForPausedPlayers();
public CheckForPausedPlayers()
{
    foreach(new i: Player)
    {
        if(PlayerPaused[i] == false)
        {
            InactiveTime[i] ++;
            if(InactiveTime[i] == 5) PlayerPaused[i] = true; // Player has paused their game.
        }
    }
}
Reply
#6

it uses IsPlayerAltTabbing to detect if the player is paused/AFK, just as the little hourglass on the player name does. Besides, what good is it to OP, if you just say that it's useless and don't provide the proper link yourself?
Reply
#7

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
it uses IsPlayerAltTabbing to detect if the player is paused/AFK, just as the little hourglass on the player name does. Besides, what good is it to OP, if you just say that it's useless and don't provide the proper link yourself?
I wasn't referring to your post; quotes clearly mean nothing to you.
The guy that I quoted gave a link to code that literally did nothing without the include 'paused', which was not supplied with the link he gave.
Reply
#8

Actually, OnPlayerUpdate not being called doesn't tell you what the OP is asking. He is asking for detection if they are in the PAUSE MENU, - not if they are tabbed. How-ever, - they could plain out be tabbed outside of the menu. So, - in a direct answer, - as far as I know it's not detectable how-ever you can detect if they are AFK / Tabbed using OnPlayerUpdate.
Reply
#9

Quote:
Originally Posted by Catalyst-
Посмотреть сообщение
I wasn't referring to your post; quotes clearly mean nothing to you.
The guy that I quoted gave a link to code that literally did nothing without the include 'paused', which was not supplied with the link he gave.
LOL I don't know what I read, jesus christ.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)