dcmd_admins is bugged a little bit
#1

This is my command /admins (DCMD). It works fine! The bug if when 2 or more admins are on line and shown in /admins. When they log off, the last admins will be shown twice or more in their place.

Example:

Online Admins:
[UF]DarkPhoenix [Level: 5] [ID: 11]
CyberMan [Level: 3] [ID: 6]

CyberMan has left the server. (Leaving)


Online Admins:
[UF]DarkPhoenix [Level: 5] [ID: 11]
[UF]DarkPhoenix [Level: 5] [ID: 6]

pawn Код:
dcmd_admins(playerid, params[])
{
  #pragma unused params
  print("Admins command 1");
  new adminscount = 0,string[128],adminName[MAX_PLAYER_NAME];

  for(new i=0;i<MAX_PLAYERS;i++)
    if(pInfo[i][pAdmin] > 0 || IsPlayerAdmin(i)) adminscount ++;

  if(adminscount == 0) return SendClientMessage(playerid, COLOR_BLUE, "There are currently no Admins online.");

  SendClientMessage(playerid, COLOR_BLUE, "------------------------------------");
  SendClientMessage(playerid, COLOR_RED, "Admins Online:");
  print("Admins command 2");
  for(new j=0;j<MAX_PLAYERS;j++)
  {
    if(pInfo[j][pAdmin] > 0 || IsPlayerAdmin(j))
   {
     print("Admins command 3");
     GetPlayerName(j,adminName,sizeof(adminName));
     format(string,sizeof(string),"%s [Level: %d] [ID: %d]",adminName,pInfo[j][pAdmin],j);
     SendClientMessage(playerid, COLOR_GREEN, string);
   }
  }
  return 1;
}
Reply
#2

pawn Код:
dcmd_admins(playerid, params[])
{
  #pragma unused params
  print("Admins command 1");
  new adminscount = 0,string[128],adminName[MAX_PLAYER_NAME];

  for(new i=0;i<MAX_PLAYERS;i++)
    if(pInfo[i][pAdmin] > 0 || IsPlayerAdmin(i)) adminscount ++;

  if(adminscount == 0) return SendClientMessage(playerid, COLOR_BLUE, "There are currently no Admins online.");

  SendClientMessage(playerid, COLOR_BLUE, "------------------------------------");
  SendClientMessage(playerid, COLOR_RED, "Admins Online:");
  print("Admins command 2");
  for(new j=0;j<MAX_PLAYERS;j++)
  {
    if(pInfo[j][pAdmin] > 0 || IsPlayerAdmin(j))
   {
     if(IsPlayerConnected(j))
     {
       print("Admins command 3");
       GetPlayerName(j,adminName,sizeof(adminName));
       format(string,sizeof(string),"%s [Level: %d] [ID: %d]",adminName,pInfo[j][pAdmin],j);
       SendClientMessage(playerid, COLOR_GREEN, string);
     }
   }
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)