Wanted
#3

Quote:
Originally Posted by Razvann
Код:
	if(!strcmp(cmdtext, "/wanted", true))
	{
	  if(IsPlayerConnected(playerid))
	 	{
			if(gTeam[playerid] == 2 || IsACop(playerid))
			{
	 	    new count = 0;
				SendClientMessage(playerid, COLOR_GREEN, "Current Wanted Suspects:");
			  for(new i = 0; i < 500; i++)
				{
					if(IsPlayerConnected(i))
					{
					  if(WantedLevel[i] > 1)
					  {
					  	new name[MAX_PLAYER_NAME];
	  					GetPlayerName(playerid, name, sizeof(name));
							format(string, 256, "[%d]%s - Wanted Level: [%d]", playerid,name,WantedLevel[i]);
							SendClientMessage(playerid, 0xFFFFFFAA, string);
							count++;
						}
					}
				}
				if(!count)
				{
					SendClientMessage(playerid, 0xFF6347AA, "* Currently no suspect online.");
				}
			}
			else
			{
				SendClientMessage(playerid, 0xFFFFFFAA, " You are not a Cop !");
			}
		}
		return 1;
	}
When 2 players are on the server and for example their names are:
1. Player1
2. Player2
and both haves wanted when Player1 write /wanted it appears:
[0]Player1 - Wanted Level 3
[0]Player1 - Wanted Level 4 - this is Player2 but appears player1, why?
Why do you check IsPlayerConnected(playerid) on command? That will always be true cause non-connected players cannot write cmds..
Reply


Messages In This Thread
Wanted - by Razvann - 09.01.2010, 20:07
Re: Wanted - by Adamus - 09.01.2010, 21:04
Re: Wanted - by SiJ - 09.01.2010, 21:18

Forum Jump:


Users browsing this thread: 1 Guest(s)