[ajuda] bots invadindo o server
#1

Loguei no meu server e me deparei com mais de 150 bots dentro do server lagando tudo atй o server cair, print:


alguйm sabe como me protejo disso?
Reply
#2

Acho que isso pode ajudar.

https://sampforum.blast.hk/showthread.php?tid=332335
Reply
#3

pawn Код:
if(GetPlayerPing(playerid) >= 65535) return Kick(playerid);
if(strfind(PlayerName(playerid), "niex", true) != -1) return Ban(playerid);
Coloque isso no OnPlayerConnect(playerid);
Reply
#4

pawn Код:
new Bots[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Bots, MAX_PLAYER_NAME);
    if(!strcmp("con", Bots, true) || !strcmp("aux", Bots, true) || !strcmp("prn", Bots, true) || GetPlayerPing(playerid) >= 65535)
    {
        SetPlayerName(playerid, "TomaPiranha"), SendClientMessage(playerid, -1,"Mais uma Piranha banida uhul.");
        Ban(playerid);
        return true;
    }
Reply
#5

s4kul, nгo ajudou pq a parte do OnPlayerConnect bugou meu server, nгo tem mais a parada de digitar a senha
Reply
#6

Quote:
Originally Posted by bombomloko
Посмотреть сообщение
s4kul, nгo ajudou pq a parte do OnPlayerConnect bugou meu server, nгo tem mais a parada de digitar a senha
coloca oque o s4kul disse, depois dos code de login/registro..
Reply
#7

Quote:
Originally Posted by Joker_OutLock
Посмотреть сообщение
coloca oque o s4kul disse, depois dos code de login/registro..
tem uma parte nisso q o s4kul mandou q tem q colocar no onplayerconnect, eu coloco e da isso que eu disse.
meu onplayerconnect fica assim:
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        SpawnPlayer(playerid);
        return 1;
    }
{
    new connecting_ip[32+1];
    GetPlayerIp(playerid,connecting_ip,32);
    new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);

    if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) {
        printf("MAXIPs: Connecting player(%d) exceeded %d IP connections from %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
        Kick(playerid);
        return 1;
    }

    return 0;
}
Reply
#8

Faz como Filterscript '-'
Reply
#9

pawn Код:
#include <a_samp>
#pragma tabsize 0

#define MAX_CONNECTIONS_FROM_IP     2 // <<< define o maximo de ip que podem se conectar no servidor,й melhor deixa 2 ;)
public OnFilterScriptInit()
{
    printf("\n*** Player IP limiting FS (maxips) Loaded. Max connections from 1 IP = %d\n",MAX_CONNECTIONS_FROM_IP);
}

stock GetNumberOfPlayersOnThisIP(test_ip[])
{    new against_ip[32+1];
    new x = 0;
    new ip_count = 0;
    for(x=0; x<MAX_PLAYERS; x++) {
        if(IsPlayerConnected(x)) {
            GetPlayerIp(x,against_ip,32);
            if(!strcmp(against_ip,test_ip)) ip_count++;
        }
    }
    return ip_count;
}
public OnPlayerConnect(playerid)
{
    new connecting_ip[32+1];
    GetPlayerIp(playerid,connecting_ip,32);
    new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);

    if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) {
        printf("MAXIPs: Connecting player(%d) exceeded %d IP connections from %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
        Kick(playerid);
        return 1;
    }

    return 0;
}
use isto
Download:http://www.2shared.com/file/ItNXMkqP/bot.html
coloquei no server.cfg e na pasta ''Filterscripts''
Reply
#10

Ou se quise r+ facil adcione essa FS й sу compilar e colocar na pasta "filterscripts" e colocar o nome no server.cfg

pawn Код:
#include <a_samp>
#define COLOR_RED                                                     0xFF0000AA
#define COLOR_YELLOW                                                  0xFFFF00AA
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Sistema ANTI-BOT]");
    print("--------------------------------------\n");
    return true;
}

#endif

public OnPlayerConnect(playerid)
{
    new Nome2[30];
    GetPlayerName(playerid, Nome2, sizeof(Nome2));
    if(strfind(Nome2, "com1", true) != -1 || strfind(Nome2, "com2", true) != -1 || strfind(Nome2, "com3", true) != -1
    || strfind(Nome2, "com4", true) != -1 || strfind(Nome2, "com5", true) != -1 || strfind(Nome2, "com6", true) != -1
    || strfind(Nome2, "com7", true) != -1 || strfind(Nome2, "com8", true) != -1 || strfind(Nome2, "com9", true) != -1
    || strfind(Nome2, "lpt1", true) != -1 || strfind(Nome2, "lpt2", true) != -1 || strfind(Nome2, "lpt3", true) != -1
    || strfind(Nome2, "lpt4", true) != -1 || strfind(Nome2, "lpt5", true) != -1 || strfind(Nome2, "lpt6", true) != -1
    || strfind(Nome2, "lpt7", true) != -1 || strfind(Nome2, "lpt8", true) != -1 || strfind(Nome2, "lpt9", true) != -1
    || strfind(Nome2, "nul", true) != -1 || strfind(Nome2, "clock$", true) != -1 || strfind(Nome2, "aux", true) != -1
    || strfind(Nome2, "prn", true) != -1 || strfind(Nome2, "con", true) != -1 )
    {
    SendClientMessage(playerid, COLOR_RED, "|| •INFO• Nгo! Nгo! Vocк foi banido! :)");
    Ban(playerid);
    return true;
    }
    return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)