SA-MP Forums Archive
Idle Kick help - 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: Idle Kick help (/showthread.php?tid=420344)



Idle Kick help - Jony_Cruze - 04.03.2013

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();


Re: Idle Kick help - Trac - 04.03.2013

have you a timer to call this function ??

Quote:

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




Re: Idle Kick help - Jony_Cruze - 05.03.2013

no i don't have


Re: Idle Kick help - Jony_Cruze - 05.03.2013

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


Re: Idle Kick help - Jony_Cruze - 05.03.2013

bump


Re: Idle Kick help - Jony_Cruze - 05.03.2013

bump