[FIXED]Command spams alot((Please remove))
#1

Hi for some reason when i do this command /ds and the text it spams the whole thing this command is so if the person is inside his house and ur in the house entrance of the persons house and you do /ds you can see it,well it works mine but it spams the text please tell me what is wrong.
Код:
	if(strcmp(cmd, "/doorshout", true) == 0 || strcmp(cmd, "/ds", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	 
	    if(gPlayerLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet !");
	      return 1;
	    }
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[640];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ds)hout [local chat]");
				return 1;
			}
			 for(new i = 0; i < sizeof(HouseInfo); i++)
			{
						for(new p = 0; p < MAX_PLAYERS; p++)
			{
      if(PlayerToPoint(60, p, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
      {
 	  format(string, sizeof(string), "%s (door): %s!!", sendername, result);
 	  SendClientMessage(p, COLOR_PURPLE, string);
					  }
		
			if(PlayerInfo[playerid][pMaskuse] == 1)
			{
			MaskNumber[playerid] = 1000+random(8999);
				format(string, sizeof(string), "[Mask_%d_70] (door): %s!!",PlayerInfo[playerid][pMaskNumber],result);
			}
			else
			{
				format(string, sizeof(string), "%s (door): %s!!", sendername, result);
			}

			ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
			printf("%s", string);

		  }
		 }
		return 1;
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)