19.04.2013, 22:10
pawn Код:
stock IsAdvertisement(text[])
{
new NuCnt,DotCnt;
for (new i = 0, l = strlen(text); i < l; i++)
{
if ('0' <= text[i] <= '9'){
NuCnt++; continue;}
if(text[i] == '.' || text[i] == ':' || text[i] == '_')
if(text[i+1] != '.' && text[i+1] != ':' && text[i+1] != '_')
DotCnt++;
if (NuCnt >= 7 && DotCnt >= 3)
return true;
}
return false;
}
pawn Код:
if(IsAdvertisement(text))
{
return Kick(playerid);
}