Fake ip ban - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Fake ip ban (
/showthread.php?tid=438104)
Fake ip ban -
Geeboi_Mehdi - 18.05.2013
My anti cheat bans People for server advertising if they do ". . ." or "1.1.1" well you get the point here is the part that checks if its a ip or not
pawn Код:
stock IsIp(const string[])
{
new count = 0;
new pos[50];
new length = strlen(string);
for(new n=0; n<length; n++)
{
if(string[n] == '.')
{
if(count < 50)
{
pos[count] = n;
}
count++;
}
}
if(count >= 3)
{
new res[50];
for(new n=0; n<count; n++)
{
if(n != (count - 1) && n != count)
{
if((pos[n+1] - pos[n]) > 4 || (pos[n+1] - pos[n]) == 1)
{
res[n] = 0;
}
else
{
res[n] = 1;
}
}
}
new result = 0;
for(new n=0; n<count; n++)
{
if(res[n] == 1) result++;
}
if(result >= 2)
{
return 1;
}
}
return 0;
}
Please tell me whats wrong with it
Thanks
Re: Fake ip ban -
Geeboi_Mehdi - 18.05.2013
Any idea guys? please