Listing certain players
#6

Here's a command.
pawn Код:
#define POLICE_CLASS 1 //Change the classid to yours.
new pTeam[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
 if(classid == POLICE_CLASS)
 {
  pTeam[playerid] = POLICE_CLASS;
 }
 return 1;
}

CMD:policelist(playerid, params[])
{
 new str[30], Lname[MAX_PLAYER_NAME], str2[128];
 SendClientMessage(playerid, 0xFF0000FF, "__________________________________________");
 SendClientMessage(playerid, 0xFF0000FF, "                     Online Cops");
 SendClientMessage(playerid, -1, "");
 for(new i; i< GetMaxPlayers(); i++)
 {
  if(!IsPlayerConnected(i)) continue;
  if(pTeam[i] == POLICE_CLASS)
  {
   GetPlayerName(i, Lname, sizeof(Lname));
   format(str, sizeof(str), "%s (ID:%d)\n", Lname, i);
   strcat(str2, str, sizeof(str2));
  }
 }
 SendClientMessage(playerid, 0xFF0000, str2);
 SendClientMessage(playerid, 0xFF0000FF, "_________________________________________");
 return 1;
}
Not tested!
Reply


Messages In This Thread
Listing certain players - by BossZk - 12.05.2013, 10:51
Re: Listing certain players - by park4bmx - 12.05.2013, 10:56
Re: Listing certain players - by RajatPawar - 12.05.2013, 10:56
Re: Listing certain players - by BossZk - 12.05.2013, 11:10
Re: Listing certain players - by park4bmx - 12.05.2013, 11:12
Re: Listing certain players - by Lordzy - 12.05.2013, 11:29
Re: Listing certain players - by BossZk - 12.05.2013, 11:37

Forum Jump:


Users browsing this thread: 1 Guest(s)