SA-MP Forums Archive
/wantedlist shows the same name. - 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: /wantedlist shows the same name. (/showthread.php?tid=145846)



/wantedlist shows the same name. - sean5874 - 04.05.2010

Hello,
I have a /wantedlist cmd, so cops can see who's the bad guy, only i have a problem. Here you see the script:
Код:
if(strcmp(cmd, "/wantedlist", true)==0) {
    		  new string7[128];
    		  new string8[128];
    		  new string9[128];
    		  new Iname[MAX_PLAYERS];
    		  new lvl;
          for(new i=0; i<MAX_PLAYERS; i++)
  				{
  				  GetPlayerName(i, Iname, sizeof(Iname));
						lvl = GetPlayerWantedLevel(i);
						if(lvl > 0)
						{
		  				format(string7, sizeof(string7),"Name: %s | Wanted Level: %d",Iname, GetPlayerWantedLevel(i));
		  				format(string8, sizeof(string8),"Name: %s | Wanted Level: %d",Iname, GetPlayerWantedLevel(i));
		  				format(string9, sizeof(string9),"Name: %s | Wanted Level: %d",Iname, GetPlayerWantedLevel(i));
		  				SendClientMessage(playerid, COLOR_GREY, string7);
		  				SendClientMessage(playerid, COLOR_GREY, string8);
		  				SendClientMessage(playerid, COLOR_GREY, string9);
		  				return 1;
		  			}
		  			else
		  			{
		  			  SendClientMessage(playerid, COLOR_GREY,"There is no suspect on the run at this moment.");


		  			  return 1;
		  			}}}
I want that 3 dirrent suspects can be showed, and if theres one or two suspect, he dont have to show the empty string. But this is the problem. He shows three times the same name, instead of all suspects. Who ca help me?
Greetz,
sean5874