[Ayuda] Anti AFK NPC
#1

Lo que pasa es que el sistema de anti afk que tengo kickea algunos bot, quisiera saber como puedo aser para que no los kickeara sin sacar el sistema de anti afk

PD: y busco ayuda de alguien que sepa ocupar bien el sitema de dialog d=D
Reply
#2

usa IsPlayerNPC
Reply
#3

Quote:
Originally Posted by Andres_Garcia
Lo que pasa es que el sistema de anti afk que tengo kickea algunos bot, quisiera saber como puedo aser para que no los kickeara sin sacar el sistema de anti afk

PD: y busco ayuda de alguien que sepa ocupar bien el sitema de dialog d=D
Claro como te dijo the_chaoz, puedes agregar una condicion, que compruebe si se trata de un bot con el comando IsPlayerNPC, y si es asi, no aplique el kickeo a ese jugador que resulta ser un bot.

Saludos
Reply
#4

mmm bueno intentare ver que puedo aser
Reply
#5

Aun no encuentro la manera de que no los kickee T_T

Ese es el codigo de anti afk
pawn Код:
public IdleKick()
{

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
          if(PlayerInfo[i][pAdmin] < 1)
          {
        if (IsPlayerNPC(playerid))
           {
           }
                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])
                {
                    new plname[64];
                    new string[128];
                    GetPlayerName(i, plname, sizeof(plname));
                    format(string, sizeof(string), "Server: %s has sido kickeado del servidor, Razon: AFK", plname);
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    Kick(i);
                }
                PlayerPos[i][3] = PlayerPos[i][0];
                PlayerPos[i][4] = PlayerPos[i][1];
                PlayerPos[i][5] = PlayerPos[i][2];
            }
        }
    }
}
Reply
#6

pawn Код:
public IdleKick()
{

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerNPC(i)) return 1;
        else if(IsPlayerConnected(i))
        {
          if(PlayerInfo[i][pAdmin] < 1)
          {
                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])
                {
                    new plname[64];
                    new string[128];
                    GetPlayerName(i, plname, sizeof(plname));
                    format(string, sizeof(string), "Server: %s has sido kickeado del servidor, Razon: AFK", plname);
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    Kick(i);
                }
                PlayerPos[i][3] = PlayerPos[i][0];
                PlayerPos[i][4] = PlayerPos[i][1];
                PlayerPos[i][5] = PlayerPos[i][2];
            }
        }
    }
}
Reply
#7

Hey me tira este erro Y_Y


Quote:

C:\Documents and Settings\Bluegamez\Escritorio\Los Andes\gamemodes\larp.pwn(46166) : warning 209: function "IdleKick" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 10244 bytes
Code size: 1760852 bytes
Data size: 10559328 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4210 cells (16840 bytes)
Total requirements:12346808 bytes

1 Warning.

La linea 46166 es la ultima del code que me diste el }

Reply
#8

Quote:
Originally Posted by Andres_Garcia
Hey me tira este erro Y_Y


Quote:

C:\Documents and Settings\Bluegamez\Escritorio\Los Andes\gamemodes\larp.pwn(46166) : warning 209: function "IdleKick" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 10244 bytes
Code size: 1760852 bytes
Data size: 10559328 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4210 cells (16840 bytes)
Total requirements:12346808 bytes

1 Warning.

La linea 46166 es la ultima del code que me diste el }

No es un erorr es un warning, pon esto debajo de el ultimo" }" "return 1;"
Reply
#9

Sigue con mas errores, no se que aser ya

Puse lo que me dijiste sesar y me quedo asi

pawn Код:
public IdleKick()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerNPC(i)) return 1;
    else if(IsPlayerConnected(i))

          if(PlayerInfo[i][pAdmin] < 1)
          {
                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])
                {
                    new plname[64];
                    new string[128];
                    GetPlayerName(i, plname, sizeof(plname));
                    format(string, sizeof(string), "Administrador: %s has sido kickeado del servidor, Razon: AFK", plname);
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    Kick(i);
                }
                PlayerPos[i][3] = PlayerPos[i][0];
                PlayerPos[i][4] = PlayerPos[i][1];
                PlayerPos[i][5] = PlayerPos[i][2];
            }
        }
    }
}
return 1;

Y me tira estos errores ahora
pawn Код:
C:\Documents and Settings\Bluegamez\Escritorio\Los Andes\gamemodes\larp.pwn(46165) : warning 209: function "IdleKick" should return a value
C:\Documents and Settings\Bluegamez\Escritorio\Los Andes\gamemodes\larp.pwn(46166) : error 054: unmatched closing brace ("}")
C:\Documents and Settings\Bluegamez\Escritorio\Los Andes\gamemodes\larp.pwn(46167) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

Reply
#10

Usб este cуdigo:

pawn Код:
public IdleKick()
{

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
          if(PlayerInfo[i][pAdmin] < 1 && !IsPlayerNPC(playerid))
          {
                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])
                {
                    new plname[64];
                    new string[128];
                    GetPlayerName(i, plname, sizeof(plname));
                    format(string, sizeof(string), "Server: %s has sido kickeado del servidor, Razon: AFK", plname);
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    Kick(i);
                }
                PlayerPos[i][3] = PlayerPos[i][0];
                PlayerPos[i][4] = PlayerPos[i][1];
                PlayerPos[i][5] = PlayerPos[i][2];
            }
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)