[FilterScript] Easy Anti Desktop
#1

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.
Reply
#2

Nice fs good work thnx and its usefull.
Reply
#3

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

Yup, actually, it works pretty nice.

Good work PSPgamer_10 !
Reply
#5

An anti afk?
Reply
#6

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

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.
Reply
#8

Good work!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)