Bonjour,
J'ai un problème avec mon système d'afk, j'aimerai que s'y un membre du staff et AFK, sa le kick pas.
public AFK(playerid)
{
new nomjoueur[MAX_PLAYER_NAME];
new Float:x,Float:y,Float:z,string[128];
for(new i=0;i<MAX_PLAYERS;i++)
{
GetPlayerName(i, nomjoueur, sizeof(nomjoueur));
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pAdmin] == 0)
{
GetPlayerPos(i,x,y,z);
if(AFKPos[i][1] == 0)
{
AFKPos[i][0] = x;
AFKPos[i][1] = y;
AFKPos[i][2] = z;
}
else if(x == AFKPos[i][0] && y == AFKPos[i][1] && z == AFKPos[i][2])
{
AFKMin[i]++;
if(AFKMin[i] >= AFKMaxMin)
{
format(string,sizeof(string),"[INFO] %s a été kické. Raison: AFK pendant plus de %d minutes",nomjoueur,AFKMaxMin);
SendClientMessageToAll(COLOR_LIGHTRED,string);
Kick(i);
}
}
AFKPos[i][0] = x;
AFKPos[i][1] = y;
AFKPos[i][2] = z;
}
}
}
}
Voilà, merci d'avance ^^