public FicarAFK(playerid) { if(PlayerToPoint(0.8, playerid, AfkX, AfkY, AfkZ)) { AFK[playerid]=1; SetPlayerVirtualWorld(playerid, 1); SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid,0); TextDrawShowForPlayer(playerid,AfkText); TextDrawShowForPlayer(playerid,AfkBackText); new string[256]; format(string, sizeof(string), "%s (%d) estб afk(/afk)", Nome(playerid), playerid); ProxDetector(100.0, playerid, string,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COL OR_RED); return 1; } else { AFK[playerid] = 0; SendClientMessage(playerid,COLOR_RED,"Voce nao esta mais no local onde digitou o comando."); return 1; } } |
#define TEMPO_AFK Coloque o Tempo aqui
new Float:Posicoes[MAX_PLAYERS][6];
new TAFK[MAX_PLAYERS];
TAFK[playerid] = 0;
GetPlayerPos(i, Posicoes[i][0], Posicoes[i][1], Posicoes[i][2]);
if(Posicoes[i][0] == Posicoes[i][3] && Posicoes[i][1] == Posicoes[i][4] && Posicoes[i][2] == Posicoes[i][5])
{
TAFK[i] += 1;
if(TAFK[i] >= TEMPO_AFK)
{
TAFK[i] = 0;
SendClientMessage(i, COR_NEGATIVO, "Vocк foi kikado por estar parado muito tempo!");
Kick(i);
}
}
else
{
Posicoes[i][3] = Posicoes[i][0];
Posicoes[i][4] = Posicoes[i][1];
Posicoes[i][5] = Posicoes[i][2];
TAFK[i] = 0;
}
Adapte ao seu gamemode . Espero ter ajudado . |
pwn(3924) : error 021: symbol already defined: "GetPlayerPos" pwn(3925) : error 010: invalid function or declaration pwn(3928) : error 010: invalid function or declaration pwn(3929) : error 010: invalid function or declaration pwn(3932) : error 010: invalid function or declaration pwn(3937) : error 010: invalid function or declaration pwn(3940) : error 010: invalid function or declaration pwn(78521) : warning 203: symbol is never used: "Posicoes"
#define TEMPO_AFK 1800000
new AFK[MAX_PLAYERS];
AFK[i]= 0;
new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X, Y, Z); if(playerid, X, Y, Z) { AFK(playerid) += 1; if(AFK(playerid) >= TEMPO_AFK) { AFK(playerid) = 0; SendClientMessage(playerid, 0xFF0000AA, "Vocк Foi Kickado por ficar AFK por muito tempo!"); Kick(i); } } else { AFK[i] = 0; }