Afk on esc - 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: Afk on esc (
/showthread.php?tid=529596)
Afk on esc -
youssefehab500 - 03.08.2014
hi, well i saw a lot of AFK[FSs] on the forum but i wanted to make mine so i made all but wanted to make it to check if the player is on esc window but searched and found that its impossible but on other afk fs i found its possible but didn't know how to if anyone can just lead me to it by a script/wiki or anything ill appreciate it
Re: Afk on esc -
youssefehab500 - 03.08.2014
Bump anyone come atleast one reply
Re: Afk on esc -
SickAttack - 03.08.2014
This detects if a player pauses their game with ESC or ALT + TAB.
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: Afk on esc -
youssefehab500 - 03.08.2014
Quote:
Originally Posted by SickAttack
This detects if a player pauses their game with ESC or ALT + TAB.
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. } } } }
|
ty very much ill test it and tell u anyways ill Rep+ u