04.03.2013, 15:52
I have an Role-Play Gamemode and the Idle kick doesn't work here is the code
and
forward IdleKick();
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();