SA-MP Forums Archive
[FilterScript] AFK system ( little diffrent than other systems, detecting possible AFK players ) - 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] AFK system ( little diffrent than other systems, detecting possible AFK players ) (/showthread.php?tid=234999)



AFK system ( little diffrent than other systems, detecting possible AFK players ) - Mean - 04.03.2011

Hello there, I realased a filterscript lulz.

What does it do?
If a player is not moving for 30 seconds, it will send a message to RCON admins that a player might be AFK. You can change it so it doesn't send to RCON admins, but to your own admin system.

Any screenshots?


Download:
Click here for Mean's AFK system.


Re: AFK system ( little diffrent, detecting possible AFK players ) - Marricio - 04.03.2011

Well, in my opinion, another one.


Re: AFK system ( little diffrent, detecting possible AFK players ) - Mean - 04.03.2011

Yes, but everyone is putting the /afk & /back commands. I've decided to detect possible AFK players.
I know, there are more efficient methods to do this, but I think this one is the most lag-free.


Re: AFK system ( little diffrent than other systems, detecting possible AFK players ) - Marricio - 04.03.2011

Well, i still personally think ''Another one''.
But i forgot to say this has more options. So i didn't say it wasn't bad, so its good.

But, still another one
Nice.


Re: AFK system ( little diffrent than other systems, detecting possible AFK players ) - Mean - 04.03.2011

LoL. Thank you.


Re: AFK system ( little diffrent than other systems, detecting possible AFK players ) - Master_Gangster - 04.03.2011

to make it kick the player due to 30 seconds of inactivity do something like this:

Код:
#include < a_samp >
#include < a_npc >
#include < foreach >

#define RED 0xE60000FF

new Float:x, Float:y, Float:z;
new Float:x2, Float:y2, Float:z2;

public OnPlayerConnect( playerid )
{
	SetTimerEx( "CheckForAfk", 30000, 1, "i", playerid );
	return 1;
}

forward CheckForAfk( playerid );
public CheckForAfk( playerid )
{
	GetPlayerPos( playerid, x, y, z );
	if( x == x2 && y == y2 && z == z2 )
	{
		foreach(Player, i) if(!IsPlayerNPC(i))
		{
		   SendClientMessage(i, RED, "You have been kicked due to massive inactivity.");
		   Kick(i);
		}
	}
	GetPlayerPos( playerid, x2, y2, z2 );
	return 1;
}
BTW I used "foreach" in this since I find it ALOT faster than the normal usage.


Re: AFK system ( little diffrent than other systems, detecting possible AFK players ) - Zh3r0 - 05.03.2011

How can 30 seconds of AFK can be massive :O


Re: AFK system ( little diffrent than other systems, detecting possible AFK players ) - viKKmaN - 05.03.2011

Quote:
Originally Posted by Master_Gangster
Посмотреть сообщение
to make it kick the player due to 30 seconds of inactivity do something like this:

Код:
#include < a_samp >
#include < a_npc >
#include < foreach >

#define RED 0xE60000FF

new Float:x, Float:y, Float:z;
new Float:x2, Float:y2, Float:z2;

public OnPlayerConnect( playerid )
{
	SetTimerEx( "CheckForAfk", 30000, 1, "i", playerid );
	return 1;
}

forward CheckForAfk( playerid );
public CheckForAfk( playerid )
{
	GetPlayerPos( playerid, x, y, z );
	if( x == x2 && y == y2 && z == z2 )
	{
		foreach(Player, i) if(!IsPlayerNPC(i))
		{
		   SendClientMessage(i, RED, "You have been kicked due to massive inactivity.");
		   Kick(i);
		}
	}
	GetPlayerPos( playerid, x2, y2, z2 );
	return 1;
}
BTW I used "foreach" in this since I find it ALOT faster than the normal usage.
Why kick the player? Your only goal is to mark those who are AFK, thinking that they might come back and continue playing... It's annoying for them to be kicked 30 seconds after they went AFK...
The whole point of AFK systems is to make them "immune" until they return so they won't lose progress.


Re: AFK system ( little diffrent than other systems, detecting possible AFK players ) - Zh3r0 - 05.03.2011

Quote:
Originally Posted by viKKmaN
Посмотреть сообщение
Why kick the player? Your only goal is to mark those who are AFK, thinking that they might come back and continue playing... It's annoying for them to be kicked 30 seconds after they went AFK...
The whole point of AFK systems is to make them "immune" until they return so they won't lose progress.
Not really, they can be kicked for the reason for staying on the server just like that, and making Hours++...


Re: AFK system ( little diffrent than other systems, detecting possible AFK players ) - Master_Gangster - 05.03.2011

Quote:
Originally Posted by viKKmaN
Посмотреть сообщение
Why kick the player? Your only goal is to mark those who are AFK, thinking that they might come back and continue playing... It's annoying for them to be kicked 30 seconds after they went AFK...
The whole point of AFK systems is to make them "immune" until they return so they won't lose progress.
*look* a guy from an earlier post just like this one suggested that if it makes it kick the player it would be much better, "FOR HIM" and he said he would like it. SO I simply made it FOR HIM. if anyone else wants to use it, they can.