Idle Kick help
#1

I have an Role-Play Gamemode and the Idle kick doesn't work here is the code

pawn Код:
public IdleKick()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            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])
            {
                if(gPlayerLogged[i] == 1 && PlayerInfo[i][pAdministrator] < 3)
                {
                    TogglePlayerControllable(i, 0);
                    SendClientMessage(i, COLOR_LIGHTRED, "SvrCmd: Ai primit kick de la SERVER, Motiv: AFK");
                    Kick(i);
                }
            }
            PlayerPos[i][3] = PlayerPos[i][0];
            PlayerPos[i][4] = PlayerPos[i][1];
            PlayerPos[i][5] = PlayerPos[i][2];
        }
    }
}

and

forward IdleKick();
Reply
#2

have you a timer to call this function ??

Quote:

SetTimer("IdleKick()", 10000, 1);

Reply
#3

no i don't have
Reply
#4

I put the timer in ongamemodeinit and doesn't work !
SetTimer("IdleKick()", 60000, 1);
Reply
#5

bump
Reply
#6

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)