Alt + Tab
#17

Quote:
Originally Posted by Cypog
Посмотреть сообщение
What if somebody hasn't assigned alt? (He can ALT TAB and you won't see it)
What if somebody has asigned another key to slow walking? (He will be shown as ALT Tabber, although hes isn't)

IT IS NOT WORKING!

If you want to make an AFK detection, you can do it with OnPlayerUpdate, but not with checking keys.

Edit: Don't use pVars!
Why not? PVars aren't slow, they're just not as fast as normal variables, sure. But that's all.

pawn Код:
public OnPlayerUpdate(playerid)
{
  SetPVarInt(playerid, "TC", GetTickCount());
  return 1;
}

public OnGameModeInit()
{
  SetTimer("CheckAFK", 1500, 1);
  return 1;
}

forward CheckAFK();
public CheckAFK()
{
  new tc = GetTickCount();
  for(new i; i < MAX_PLAYERS; i++)
  {
    if(tc - GetPVarInt(playerid, "TC") >= 1500)
    {
      //Do stuff with the AFK user here
    }
  }
}
Reply


Messages In This Thread
Alt + Tab - by Anthonyx3' - 28.11.2010, 01:39
Re: Alt + Tab - by XoSarahMoX - 28.11.2010, 01:50
Re: Alt + Tab - by Anthonyx3' - 28.11.2010, 02:08
Re: Alt + Tab - by Cypog - 28.11.2010, 02:27
Re: Alt + Tab - by Fj0rtizFredde - 28.11.2010, 02:29
Re: Alt + Tab - by cessil - 28.11.2010, 02:30
Re: Alt + Tab - by Cypog - 28.11.2010, 02:34
Re: Alt + Tab - by cessil - 28.11.2010, 02:39
Re: Alt + Tab - by Cypog - 28.11.2010, 02:49
Re: Alt + Tab - by Anthonyx3' - 28.11.2010, 03:04
Re: Alt + Tab - by cessil - 28.11.2010, 03:08
Re: Alt + Tab - by Anthonyx3' - 28.11.2010, 03:18
Re: Alt + Tab - by Retardedwolf - 28.11.2010, 03:20
Re: Alt + Tab - by cessil - 28.11.2010, 03:23
Re: Alt + Tab - by Cypog - 28.11.2010, 11:57
Re: Alt + Tab - by The_Moddler - 28.11.2010, 12:07
Re: Alt + Tab - by Hiddos - 28.11.2010, 12:10
Re: Alt + Tab - by Cypog - 28.11.2010, 13:09

Forum Jump:


Users browsing this thread: 12 Guest(s)