SA-MP Forums Archive
[FilterScript] Easy Anti Desktop - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Easy Anti Desktop (/showthread.php?tid=239431)



Easy Anti Desktop - PSPgamer_10 - 13.03.2011

FOREWORD
Hi! You know what this do and is.

HOW TO USE
There is a definition on the Top: "
#define MAX_DESKTOP_TIME 120".
With this definition, you can change the Time (in seconds) how long the Player can be on the Desktop / in the Pause Menu.
He will be kicked if the he's too long on the Desktop.

DOWNLOAD
Show ADT.pwn - pastebin.com

Download Anti-Desktop_bY_FoxHound.rar - SolidFiles
Download Anti-Desktop_bY_FoxHound.rar - SendSpace

CLOSEWORD
Have Fun with it.

Greetz, Peace'n'Lovez.



Re: Easy Anti Desktop - Davz*|*Criss - 13.03.2011

Nice fs good work thnx and its usefull.


Re: Easy Anti Desktop - GaGlets(R) - 13.03.2011

That works? I saw the script but can`t get it. Someone test it.


Re: Easy Anti Desktop - xRyder - 13.03.2011

Yup, actually, it works pretty nice.

Good work PSPgamer_10 !


Re: Easy Anti Desktop - Phanto90 - 13.03.2011

An anti afk?


Re: Easy Anti Desktop - Medal Of Honor team - 13.03.2011

u can make a thing like if a player is in the pause menu, his health will be lowered when someone shot him


Re: Easy Anti Desktop - $t3ve - 01.04.2011

Can be written much easier:

Код:
#define MAX_AFK_TIME 20000              	// The player's maximal afk time.
forward CheckPlayers();
forward OnPlayerPause(playerid);
enum e_STATE
{
	e_STATE_UPDATING,
	e_STATE_NONE,
 	e_STATE_CONNECTED
}
new gLastUpdate[MAX_PLAYERS];
new e_STATE:gState[MAX_PLAYERS] = {e_STATE_NONE, ...};

public OnGameModeInit()
{
	SetTimer("CheckPlayers", 1000, 1);
	return 1;
}
public OnPlayerConnect(playerid)
{
        gState[playerid] = e_STATE_CONNECTED;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
        gState[playerid] = e_STATE_NONE;
	return 1;
}

public OnPlayerUpdate(playerid)
{
	gLastUpdate[playerid] = GetTickCount();
 	gState[playerid] = e_STATE_UPDATING;
	return 1;
}

public CheckPlayers()
{
	for(new i; i < MAX_PLAYERS; ++i)
	{
		if((gState[i] == e_STATE_UPDATING) && (GetTickCount() - MAX_AFK_TIME >= gLastUpdate[i]))
		{
			CallLocalFunction("OnPlayerPause", "d", i);
		}
	}
	return 1;
}

public OnPlayerPause(playerid)
{
	// Code here
	return 1;
}
Untested, testing it now.


Re: Easy Anti Desktop - Ironboy - 01.04.2011

Good work!