02.09.2017, 15:12
You can use simple anti for incoming connections spam
Код:
new playerC[MAX_PLAYERS]; new playerLastConnect=0, playerLastIP[16]="______", connectTime=0; public OnPlayerConnect(playerid) { playerC[playerid] = 0; return 1; } public OnIncomingConnection(playerid, ip_address[], port) { if(!strcmp(ip_address, playerLastIP)) { if(NetStats_ConnectionStatus(playerid) == 6) { playerC[playerid] ++; if(playerC[playerid] >= 4) { BlockIpAddress(ip_address, 80000); printf("IP: %s probably incoming spam", ip_address); playerC[playerid] = 0; } } } if(playerLastConnect == playerid && gettime() - connectTime < 2 && !strcmp(ip_address, playerLastIP)) return BlockIpAddress(ip_address, 70000), printf("IP: %s blocked incoming", ip_address); playerLastConnect = playerid; connectTime = gettime(); return format(playerLastIP, 16, ip_address); }