[Help] /admins command. [SOLVED]
#1

I have a problem with this command,when i type /admins it gives the LEVEL and the ID of the first admin,
for example i logged in first so when i type /admins it shows my ID and my LEVEL to all the admin!
i think it's something with the loop but i haven't figured it out yet.

Quote:

if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 133
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "[Level:%d] %s (ID:%d)", sendername,PlayerInfo[playerid][pAdmin],playerid);

SendClientMessage(playerid, COLOR_GREEN, string);

}
}
}
}
return 1;
}

thanks alot!
Reply
#2

pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
  {
    if(IsPlayerConnected(playerid))
    {
     SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:");
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
      if(IsPlayerConnected(i))
      {
        if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
        {
         GetPlayerName(i, sendername, sizeof(sendername));
         format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);

         SendClientMessage(playerid, COLOR_GREEN, string);

        }
      }
     }
   }
   return 1;
  }
Try that
Reply
#3

Quote:
Originally Posted by Gijs (TSG-Hosting.de)
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
 {
    if(IsPlayerConnected(playerid))
   {
    SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
        {
         GetPlayerName(i, sendername, sizeof(sendername));
         format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);

         SendClientMessage(playerid, COLOR_GREEN, string);

       }
      }
    }
   }
   return 1;
 }
Try that
Lol? You just copied and pasted the same code
Reply
#4

Quote:
Originally Posted by » ded «
Lol? You just copied and pasted the same code
No, he didn't.

But you should read this.
Reply
#5

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by » ded «
Lol? You just copied and pasted the same code
No, he didn't.

But you should read this.
What did he change then ...
Reply
#6

i think you need to learn some pawn
Because PlayerInfo[playerid][pAdmin] is [red]NOT[/red] the same as PlayerInfo[pAdmin]
some of your stuff is not good try my code and tell us what happens
Reply
#7

Ahhh gay, forgive me I misread.
Reply
#8

Quote:
Originally Posted by » ded «
Ahhh gay, forgive me I misread.
The 'gay' part wasn't necessary.

Go to the GF topic as it's related to the GF..
Reply
#9

Quote:
Originally Posted by Gijs (TSG-Hosting.de)
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
 {
    if(IsPlayerConnected(playerid))
   {
    SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
        {
         GetPlayerName(i, sendername, sizeof(sendername));
         format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);

         SendClientMessage(playerid, COLOR_GREEN, string);

       }
      }
    }
   }
   return 1;
 }
Try that
thanks! it works now hehe,but the id still 1 ;p maybe i'll change playerid to I?
Reply
#10

Quote:
Originally Posted by Nakash
Quote:
Originally Posted by Gijs (TSG-Hosting.de)
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
  {
    if(IsPlayerConnected(playerid))
    {
     SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:");
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
      if(IsPlayerConnected(i))
      {
        if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
        {
         GetPlayerName(i, sendername, sizeof(sendername));
         format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);

         SendClientMessage(playerid, COLOR_GREEN, string);

        }
      }
     }
   }
   return 1;
  }
Try that
thanks! it works now hehe,but the id still 1 ;p maybe i'll change playerid to I?
yes if you do that then it will work

Gijs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)