[ajuda] attacks
#7

Quote:
Originally Posted by delete
Посмотреть сообщение
PHP код:
// maxips FS limits the number of players connecting from a
// single IP address.
#include <a_samp>
#define MAX_CONNECTIONS_FROM_IP     3
//---------------------------------------------
public OnFilterScriptInit()
{
    
printf("\n*** Player IP limiting FS (maxips) Loaded. Max connections from 1 IP = %d\n",MAX_CONNECTIONS_FROM_IP);
}
//---------------------------------------------
// GetNumberOfPlayersOnThisIP
// Returns the number of players connecting from the
// provided IP address
stock GetNumberOfPlayersOnThisIP(test_ip[])
{
    new 
against_ip[32+1];
    new 
0;
    new 
ip_count 0;
    for(
x=0x<MAX_PLAYERSx++) {
        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."playeridMAX_CONNECTIONS_FROM_IPconnecting_ip);
        
Kick(playerid);
        return 
1;
    }
    return 
0;

OBSERVAÇÃO :
" printf("\n*** Player IP limiting FS (maxips) Loaded. Max connections from 1 IP "
Isso dizendo que o maximo de conexões por ip é 1 , ai vc olha pra cima :
" #define MAX_CONNECTIONS_FROM_IP 3 "

kkk

xD
Reply


Messages In This Thread
[ajuda] attacks - by |_MeGaTroN_| - 24.02.2012, 00:20
Re: [ajuda] attacks - by PlayeR_TheReturN - 24.02.2012, 00:24
Re: [ajuda] attacks - by |_MeGaTroN_| - 24.02.2012, 00:26
Re: [ajuda] attacks - by Delete_ - 24.02.2012, 12:57
Re: [ajuda] attacks - by PlayeR_TheReturN - 24.02.2012, 13:15
Re: [ajuda] attacks - by Delete_ - 24.02.2012, 13:21
Re: [ajuda] attacks - by Felipe_Freeze - 26.02.2012, 00:34

Forum Jump:


Users browsing this thread: 2 Guest(s)