07.09.2015, 19:31
Код:
stock CheckServerAd(szInput[])
{
new
iCount,
iPeriod,
iPos,
iChar,
iColon;
while((iChar = szInput[iPos++])) {
if('0' <= iChar <= '9') iCount++;
else if(iChar == '.') iPeriod++;
else if(iChar == ':') iColon++;
}
if(iCount >= 7 && iPeriod >= 3 && iColon >= 1) {
return 1;
}
return 0;
}
Код:
stock AntiAdv(playerid, text[])
{
// Anti Adv
new strR[255], is1=0, r=0;
while(strlen(text[is1]))
{
if('0'<=text[is1]<='9')
{
new is2=is1+1, p=0;
while(p==0)
{
if('0'<=text[is2]<='9'&&strlen(text[is2]))
{
is2++;
}
else
{
strmid(strR[r],text,is1,is2,255);
if(strval(strR[r])<255) r++;
is1=is2;
p=1;
}
}
}
is1++;
}
if(r>=4)
{
new strMy[255];
format(strMy, sizeof(strMy), "AdmCmd: %s is attempting to Server Advertise: %s", GetPlayerNameEx(playerid), text);
ABroadCast(COLOR_YELLOW, strMy, 2);
new pr2;
for(new z=0;z<r;z++)
{
while((pr2=strfind(text,strR[z],true))!=-1)
{
for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++)
{
text[i]='*';
}
}
}
return 1;
}
return 0;
}

