19.04.2013, 19:59
when i do some thing like . . . i get banned for advertising but if you post a Real ip u do get banned but still how can i know if some one is actually is advertising and some one isnt here is the part
i think this is the ip because here is the were he bans
if this isnt it just let me know
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;
}
pawn Код:
if(IsIp(text) && PInfo[playerid][AdminLevel] < 5)
{
new string[256];
format(string, sizeof(string), "{FFFFFF}Administrator {FF9900}Johnny{FFFFFF} Thinks {FF9900}%s(%d){FFFFFF} is server Advertising!!", PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_ERROR, string);
return 0;
}