SA-MP Forums Archive
[Ayuda] Anti AFK NPC - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda] Anti AFK NPC (/showthread.php?tid=144968)



[Ayuda] Anti AFK NPC - Andres_Garcia - 30.04.2010

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


Re: [Ayuda] Anti AFK NPC - TheChaoz - 30.04.2010

usa IsPlayerNPC


Re: [Ayuda] Anti AFK NPC - wylly - 30.04.2010

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


Re: [Ayuda] Anti AFK NPC - Andres_Garcia - 30.04.2010

mmm bueno intentare ver que puedo aser


Re: [Ayuda] Anti AFK NPC - Andres_Garcia - 07.05.2010

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];
            }
        }
    }
}



Re: [Ayuda] Anti AFK NPC - Miguel - 08.05.2010

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];
            }
        }
    }
}



Re: [Ayuda] Anti AFK NPC - Andres_Garcia - 08.05.2010

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 }




Re: [Ayuda] Anti AFK NPC - Cesar_Biker - 08.05.2010

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;"


Re: [Ayuda] Anti AFK NPC - Andres_Garcia - 09.05.2010

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.




Re: [Ayuda] Anti AFK NPC - Zamaroht - 09.05.2010

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];
            }
        }
    }
}