Код:
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);
}
}
}
}
}
}