SA-MP Forums Archive
Problem In AFK Kick - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem In AFK Kick (/showthread.php?tid=654392)



Problem In AFK Kick - marshmallow - 27.05.2018

Hi when a player is AFK For more 1800 Sec Like this : 6000 Sec AFK
server dosent kick player for afk
This is lines:
Where is problem ?please help i give +rep
Код:
public TwoMinutesTimer()
{
	if(kickafk == 1)
	{
		new name[30],string[128];
		foreach(new i : Player)
		{
			if(IsPlayerConnected(i))
			{
				if(IsBot[i] == 0)
				{
					if(PlayerInfo[i][pSleeping] == 0)
					{
						if(IsPlayerAFK[i] >= 1680)
						{
							SS(i, COLOR_LIGHTRED, "If you don't move you will be kicked in 2 minutes.", "If you don't move you will be kicked in 2 minutes.");
						}
						if(IsPlayerAFK[i] >= 1800)
						{
							SS(i, COLOR_WHITE, "Shoma az server kick shodid zira bish az 30daghighe dar server afk bodid.", "You were kicked for being AFK (away from keyboard) for more than 30 minutes.");
							SS(i, COLOR_WHITE, "baraye inke AFK nashid bayad bekhabid berid dar khaneh va /sleep bezanid.", "To leave your character AFK for longer than 30 minutes, use /sleep in a house.");
							SendClientMessage(i, COLOR_GENANNOUNCE, "You have been kicked for being AFK.");
							GetPlayerName(i, name, sizeof(name));
							format(string, sizeof(string),"%s was kicked by AdmBot for being AFK for more than 30 minutes.",name);
							SendClientMessageToAll(COLOR_LIGHTRED, string);
							new var100[300];
							mysql_format(SQL, var100, sizeof(var100), "INSERT INTO kicklogs (`playerid`,`giverid`,`playername`,`givername`,`reason`) VALUES ('%d','3','%s','AdmBot','AFK for more than 30 minutes')", PlayerInfo[i][pSQLID],PlayerInfo[i][pNormalName]);
							mysql_tquery(SQL,var100,"","");
							KickEx(i);
						}
					}
				}
			}
		}
	}



Re: Problem In AFK Kick - Mugala - 28.05.2018

check the statement for this - if(PlayerInfo[i][pSleeping] == 0)


Re: Problem In AFK Kick - marshmallow - 28.05.2018

Quote:
Originally Posted by Mugala
Посмотреть сообщение
check the statement for this - if(PlayerInfo[i][pSleeping] == 0)
what?