SA-MP Forums Archive
[Include] OnPlayerAfk - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] OnPlayerAfk (/showthread.php?tid=482793)



OnPlayerAfk - HavingGood - 22.12.2013

Hi, I'd like to present you OnPlayerAfk library and sample script use.


Script:

Код:
forward OnPlayerAfk(playerid, bool:afk);
public OnPlayerAfk(playerid, bool:afk){

	new string[30];
	format( string, sizeof( string ), "Player %s (%d) %s", getPlayerNick(playerid), playerid, (afk==true)?("away from keyboard"):("Already returned") );
	SendClientMessageToAll(0xFF00FF, string);
	
}
getPlayerNick( playerid ){
	new pName[ MAX_PLAYER_NAME + 1];
	GetPlayerName( playerid, pName, 30);
	return pName;
}
Download include sendspace.com

Код:
http://www.sendspace.com/file/s57aju



Re: OnPlayerAfk - Sanady - 22.12.2013

Quote:
Originally Posted by HavingGood
Посмотреть сообщение
Hi, I'd like to present you OnPlayerAfk library and sample script use.


Script:

Код:
forward OnPlayerAfk(playerid, bool:afk);
public OnPlayerAfk(playerid, bool:afk){

	new string[30];
	format( string, sizeof( string ), "Player %s (%d) %s", getPlayerNick(playerid), playerid, (afk==true)?("away from keyboard"):("Already returned") );
	SendClientMessageToAll(0xFF00FF, string);
	
}
getPlayerNick( playerid ){
	new pName[ MAX_PLAYER_NAME + 1];
	GetPlayerName( playerid, pName, 30);
	return pName;
}
Download include sendspace.com

Hmm nice nice really nice.Just tell me where you detect when player is not in game?If you find that part of code in this INC or FS what is it you will get nobel reward.


Respuesta: OnPlayerAfk - Swedky - 23.12.2013

This would give positive phalli for all sides, or probably not, but of all forms it would not work...


Re: OnPlayerAfk - Alphlax - 23.12.2013

So it kicks afk players when they're afk for how long?


Re: OnPlayerAfk - HavingGood - 23.12.2013

You need to create a timer and count the time a player AFK after a time give the kick