Code implement
#1

Код:
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;
}
how can i use the second one but without admin warning (message does not send). 2nd one blocks ">,<" characters
Reply
#2

bump
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=588163

First link (anti_advert).

More info: https://sampforum.blast.hk/showthread.php?tid=568668

anti_advert is a re-creation of anti_advert_regex in pawn. The plugin used in the thread of anti_advert_regex may cause your server to crash in some cases. And anti_advert is 3 times faster than anti_advert_regex in processing text and validating it. Consider using anti_advert instead of anti_advert_regex.

Note: Only detects valid IP Addresses.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)