[Ajuda] Server lagado
#6

Reinicia o Sv,poe ant-bot
pawn Код:
#include <a_samp>
#pragma tabsize 0

#define MAX_CONNECTIONS_FROM_IP     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;
}
'--'
Reply


Messages In This Thread
[Ajuda] Server lagado - by kinhobryant - 01.05.2012, 15:39
Re: [Ajuda] Server lagado - by Joker_OutLock - 01.05.2012, 15:42
Re: [Ajuda] Server lagado - by kinhobryant - 01.05.2012, 15:43
Re: [Ajuda] Server lagado - by SyN_GateS - 01.05.2012, 15:44
Re: [Ajuda] Server lagado - by Joker_OutLock - 01.05.2012, 15:45
Re: [Ajuda] Server lagado - by 'Duallity - 01.05.2012, 15:46
Re: [Ajuda] Server lagado - by kinhobryant - 01.05.2012, 15:46
Re: [Ajuda] Server lagado - by 'Duallity - 01.05.2012, 15:48
Re: [Ajuda] Server lagado - by kinhobryant - 01.05.2012, 15:52
Re: [Ajuda] Server lagado - by Jonas_PG - 01.05.2012, 16:02

Forum Jump:


Users browsing this thread: 1 Guest(s)