SA-MP Forums Archive
Spam :( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spam :( (/showthread.php?tid=137516)



Spam :( - ScottCFR - 29.03.2010

Does anyone know how to make this stop spamming the chat and only say who's wanted?

pawn Код:
if(strcmp("/wantedlist", cmdtext, true, 10) == 0)
        {
            new wanted[MAX_PLAYERS], name[MAX_PLAYERS];
            for(new i; i < GetMaxPlayers(); i++)
            {
                wanted[i] = GetPlayerWantedLevel(i);
                GetPlayerName(i, name, sizeof(name));
                format(string,sizeof(string),"%s - Wanted Level %d", name, wanted[i]);
                SendClientMessage(playerid, GREEN,string);
            }
            return 1;
        }



Re: Spam :( - Mikep. - 29.03.2010

pawn Код:
if(!strcmp("/wantedlist", cmdtext, true))
{
  new suspects;
  for(new i; i < GetMaxPlayers(); i++)
  {
    if(GetPlayerWantedLevel(i))
    {
      new name[MAX_PLAYER_NAME];
      GetPlayerName(i, name, sizeof(name));
      format(string,sizeof(string),"%s - Wanted Level %d", name, GetPlayerWantedLevel(i));
      SendClientMessage(i, GREEN,string);
      suspects = 1;
    }
  }
  if(!suspects) SendClientMessage(playerid,red, "No suspects.");
  return 1;
}