Jump to content
  • 0

Anti-ip intr-o comanda


jupanu

Question

1 answer to this question

Recommended Posts

if(strcmp(cmd, "/ad", true) == 0)
      {
          new message[256];
         new playername[MAX_PLAYER_NAME];
         strmid(message, cmdtext, 3, strlen(cmdtext));
         GetPlayerName(playerid, playername, sizeof(playername));
         if(!strlen(message))
         {
            SendClientMessage(playerid, 0xFF0606FF, "Type /ad [text]");
         }
         else
         {
			new is1=0;
			new r=0;
			while(strlen(message[is1]))
			{
			   if('0'<=message[is1]<='9')
			   {
				  new is2=is1+1;
				  new p=0;
				  while(p==0)
				  {
					  if('0'<=message[is2]<='9'&&strlen(message[is2])) is2++;
					else
					 {
					   strmid(String2[r],message,is1,is2,255);
					   if(strval(String2[r])<255) r++;
					   is1=is2;
					   p=1;
					}
				  }
			   }
			   is1++;
			}
			if(r>=4)
			{
			   new String[255];
			   new Anti_Name[255];
			   GetPlayerName(playerid,Anti_Name,255);
				format(String, sizeof(String), "Anti-advertisment %s(%d): %s",Anti_Name,playerid,message);
				for(new j1=0; j1 < MAX_PLAYERS;j1++)
				if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, String);
				for(new z=0;z<r;z++)
				{
					new pr2;
					while((pr2=strfind(message,String2[z],true))!=-1) for(new i=pr2,j=pr2+strlen(String2[z]);i<j;i++) message[i]='*';
				}
			}
            format(string, sizeof(string), "{FFFFFF}[Radio]{FF0000}%s {00FF00}|Messaje by {6633FF}%s {FF0000}(playerid:%d)!",message, playername, playerid);
            printf(string);
            SendClientMessageToAll(0xADFF2FAA, string);
            GivePlayerMoney(playerid,-2000);
         }

    return 1;
    }

Incearca asa.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.