SA-MP Forums Archive
How to check if the player in ESC(Menu) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to check if the player in ESC(Menu) (/showthread.php?tid=539856)



How to check if the player in ESC(Menu) - WildWave - 30.09.2014

Title...
Thanks for helpers.


Re: How to check if the player in ESC(Menu) - Bingo - 30.09.2014

Mate,

It was already added in 0.3x.

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


Re: How to check if the player in ESC(Menu) - TakeiT - 30.09.2014

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


Re: How to check if the player in ESC(Menu) - Catalyst- - 30.09.2014

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.


Re: How to check if the player in ESC(Menu) - SickAttack - 30.09.2014

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.
        }
    }
}



Re: How to check if the player in ESC(Menu) - TakeiT - 30.09.2014

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?


Re: How to check if the player in ESC(Menu) - Catalyst- - 30.09.2014

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.


Re: How to check if the player in ESC(Menu) - Abagail - 30.09.2014

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.


Re: How to check if the player in ESC(Menu) - TakeiT - 30.09.2014

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.