[Ajuda] AFK - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] AFK (
/showthread.php?tid=360716)
AFK -
[XPG]MarlonCS - 18.07.2012
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?)
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;
}
Tipo, quando o player ficar muito tempo com AFK[playerid]=1;, dб kick nele.
Re: AFK -
@Riichard - 18.07.2012
SetTimer -
SetTimerEx
So nao mando exemplo pois estou em un celular ._.
Re: AFK -
[XPG]MarlonCS - 18.07.2012
Um exemplo seria уtimo '-'
pawn Код:
forward ChecarAfk(playerid);
public ChecarAfk(playerid)
{
if(AFK[playerid]==1 && afktime[playerid] > 600000) {
SendClientMessage(playerid, COLOR_RED, "[SERVER] Vocк foi kickado por estar AFK por muito tempo!");
Kick(playerid);
format(string, sizeof string, "[SERVER] %s foi kickado por estar AFK por 10 minutos", pnome(playerid));
SendClientMessageToAll(COLOR_RED, string);
}
return 1;
}
Fiz isso mais ou menos, mas nгo sei adaptar kkkk
Re: AFK -
[XPG]MarlonCS - 18.07.2012
alguйm? \=