[Include] OnPlayerAfk
#1

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

Reply
#2

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)