18.07.2012, 18:36
O que eu faзo para quando o player ficar mais de 1 minuto parado, essa funзгo ficar assim:
AFK[playerid]=1;
E quando ele retornar, a funзгo ficar assim:
AFK[playerid]=0;
?
Outra, sobre anti-afk, tem como adaptar essa funзгo acima para kickar o player se ele ficar muito tempo ausente (por exemplo, 10 minutos?)
Tipo, quando o player ficar muito tempo com AFK[playerid]=1;, dб kick nele.
AFK[playerid]=1;
E quando ele retornar, a funзгo ficar assim:
AFK[playerid]=0;
?
Outra, sobre anti-afk, tem como adaptar essa funзгo acima para kickar o player se ele ficar muito tempo ausente (por exemplo, 10 minutos?)
pawn Код:
CMD:afk(playerid, params[])
{
if(TaX1[playerid] == true){ return SendClientMessage(playerid, COR_CINZA, "[SERVER] Vocк nгo pode usar esse comando aqui!");}
if(TaMG[playerid] == true){ return SendClientMessage(playerid, COR_CINZA, "[SERVER] Vocк nгo pode usar esse comando aqui!");}
if(TaSN[playerid] == true){ return SendClientMessage(playerid, COR_CINZA, "[SERVER] Vocк nгo pode usar esse comando aqui!");}
if(TaRPG[playerid] == true){ return SendClientMessage(playerid, COR_CINZA, "[SERVER] Vocк nгo pode usar esse comando aqui!");}
if(Ta69[playerid] == true){ return SendClientMessage(playerid, COR_CINZA, "[SERVER] Vocк nгo pode usar esse comando aqui!");}
if(Prisao[playerid] == 1){ return SendClientMessage(playerid, COR_CINZA, "[SERVER] Vocк estб preso, nгo pode usar esse comando!");}
if(AFK[playerid] == 1){
if(langague[playerid]==1) return SendClientMessage(playerid, COR_CINZA, "[SERVER] Vocк jб estб ausente!");
if(langague[playerid]==1) return SendClientMessage(playerid, COR_CINZA, "[SERVER] You are already away!");
}
AFK[playerid]=1;
if(langague[playerid]==1) SendClientMessage(playerid, COR_AZULZINHO, "[SERVER] Vocк agora estб ausente. Use /afkoff para voltar.");
if(langague[playerid]==2) SendClientMessage(playerid, COR_AZULZINHO, "[SERVER] You are away. Use /afkoff to return.");
for(new i; i < MAX_PLAYERS; i++) {
if(langague[i]==1)format(string, sizeof(string), "[SERVER] %s estб ausente. ( /afk )", pnome(playerid));
if(langague[i]==2)format(string, sizeof(string), "[SERVER] %s is away. ( /afk )", pnome(playerid));
}
SendClientMessageToAll(0xFFA500FF, string);
TogglePlayerControllable(playerid,0);
TextDrawShowForPlayer(playerid,afk[playerid]);
return 1;
}