10.05.2011, 17:11
Need Some help here guys, I got this stuff in my Gm That kicks a player if he is afk/idle for a longtime
But i want to make it only for non-admins, i mean the admins won't get kicked, The non-admins will get kicked, here is the code
But i want to make it only for non-admins, i mean the admins won't get kicked, The non-admins will get kicked, here is the code
pawn Код:
public IdleKick()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] < 1)
{
GetPlayerPos(i, PlayerPos[i][0], PlayerPos[i][1], PlayerPos[i][2]);
if(PlayerPos[i][0] == PlayerPos[i][3] && PlayerPos[i][1] == PlayerPos[i][4] && PlayerPos[i][2] == PlayerPos[i][5])
{
new plname[64];
new string[128];
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "AdmCmd: %s was kicked, reason: AFK", plname);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(i);
}
PlayerPos[i][3] = PlayerPos[i][0];
PlayerPos[i][4] = PlayerPos[i][1];
PlayerPos[i][5] = PlayerPos[i][2];
}
}
}
}