[Help] With IdleKick
#1

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
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];
            }
        }
    }
}
Reply
#2

What's wrong with the code?
Reply
#3

Nuthing, everyone gets kicked, I Want to make it so only non-admins can get kicked
Reply
#4

RCON Admins, or what?
Then change
pawn Код:
if(PlayerInfo[i][pAdmin] < 1)
to
pawn Код:
if(!IsPlayerAdmin(i))
Else, what is your IsAdmin Variable called?
Reply
#5

it's this And should i add it up of the Public Idle kick?

pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1
if that your real pic?
Reply
#6

This:
pawn Код:
if(PlayerInfo[i][pAdmin] < 1)
says that if the Level is smaller than 1, then it checks the position, else it won't. I don't see any problem in the code. Maybe you are not logged it.

Check if you have logged in.

@ No that's not me. ^^
Reply
#7

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
This:
pawn Код:
if(PlayerInfo[i][pAdmin] < 1)
says that if the Level is smaller than 1, then it checks the position, else it won't. I don't see any problem in the code. Maybe you are not logged it.

Check if you have logged in.

@ No that's not me. ^^
Since i "met" him on these forums, he always carried with him a pack of sweet-ass girls with nice spheric stuff.


@EDIT: Post below, yeah, Jeffrey.
Reply
#8

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
Since i "met" him on these forums, he always carried with him a pack of sweet-ass girls with nice spheric stuff.
You mean Jeffery?
Reply
#9

Quote:
Originally Posted by Sid_Alexander
Посмотреть сообщение
You mean Jeffery?
Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
@EDIT: Post below, yeah, Jeffrey.
Jeffery Jeffrey -_- My name is Jeffry


Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
Since i "met" him on these forums, he always carried with him a pack of sweet-ass girls with nice spheric stuff.
One for each time of the year. Winter Spring Summer Fall ^^ And two or three others.


Is it working now?
Reply
#10

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
This:
pawn Код:
if(PlayerInfo[i][pAdmin] < 1)
says that if the Level is smaller than 1, then it checks the position, else it won't. I don't see any problem in the code. Maybe you are not logged it.

Check if you have logged in.

@ No that's not me. ^^
This.


Make sure pAdmin is correctly set.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)