23.01.2012, 01:56
I've had problems with this same thing, here's how I got rid of it on my server
pawn Код:
public OnPlayerConnect(playerid)
{
ResetVars(playerid);
new time = gettime();
new IP[16];
GetPlayerIp(playerid,IP,sizeof(IP));
//server flooders
new joins;
for(new i=0;i<10;i++)
{
if(LastTenJoinTimes[i] + 10 >= time)
{
if(!strcmp(LastTenJoinIps[i],IP,false) &&
LastTenJoinIps[i][0] != '\0')
{
joins++;
}
}
}
joins += 1;//so it counts itself
if(joins >= 3)
{
//3 connects from the same IP within 10 seconds
BanEx(playerid,"Server Flooder");
}
new index;
new ttime = time;
for(new i=0;i<10;i++)
{
if(LastTenJoinTimes[i] <= ttime)
{
ttime = LastTenJoinTimes[i];
index = i;
}
}
LastTenJoinTimes[index] = time;
LastTenJoinIps[index] = IP;
}
public OnPlayerText(playerid,text[])
{
if(strfind(text,"<insert site here>",true) != -1) return 0;
}