#define MAX_CONNECTIONS_FROM_IP 3stock GetNumberOfPlayersOnThisIP(test_ip[]){new against_ip[32+1];new x = -1; // Javítva 0 playerid érték is vizsgálatra kerüljön.new ip_count = 0;for(; x++ < MAX_PLAYERS {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); BanEx(playerid, \"BOT attack!\"); return 1;}return 0;}
Jó lett, a csatlakoz-spamelõ botok ellen.Ha csak 1-et küldök fel, akkor nem dobja ki.
#define MAX_CONNECTIONS_FROM_IP 3
Írd be ezt: wgrwrg[/quote]Ha nem írja be akkor nyilván bot/külföldi.
printf(\"x:%d\", x);
#include <a_samp>#define MAX_CONNECTIONS_FROM_IP 3stock GetNumberOfPlayersOnThisIP(test_ip[]){new against_ip[32+1];new x = -1; // Javítva 0 playerid érték is vizsgálatra kerüljön.new ip_count = 0;for(; x++ < MAX_PLAYERS {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); BanEx(playerid, \"BOT attack!\"); new against_ip[32+1],test_ip[32+1]; GetPlayerIp(playerid,test_ip,32);new x = -1; // Javítva 0 playerid érték is vizsgálatra kerüljön.for(; x++ < MAX_PLAYERS { if(IsPlayerConnected(x)) { GetPlayerIp(x,against_ip,32); if(!strcmp(against_ip,test_ip)) Kick(x); }} return 1;}return 0;}