SA-MP Forums Archive
Small problem with /admins - 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: Small problem with /admins (/showthread.php?tid=116707)



Small problem with /admins - Guso - 29.12.2009

Hey, i seem to have a problem with /admins, it shows all the admins as a moderator, even level 3 admins.
Код:
	if (strcmp(cmd, "/admins", true) == 0)
	{
    if(IsPlayerConnected(playerid))
	  {
	    SendClientMessage(playerid, COLOR_LIGHTBLUE, "|____ Online IBP Admins ____|");
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
				  if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
				  {
				    new admtext[64];
						if (PlayerInfo[playerid][pAdmin] >= 1) { admtext = "Moderator"; }
						else if (PlayerInfo[playerid][pAdmin] >= 2) { admtext = "Admin"; }
					  else if (PlayerInfo[playerid][pAdmin] >= 3) { admtext = "Lead Admin"; }
						else { admtext = "Moderator"; }
						GetPlayerName(i, sendername, sizeof(sendername));
						if(AdminDuty[i] == 0)
						{
							format(string, 256, "%s: %s", admtext, sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else
						{
						  format(string, 256, "%s: %s (on duty)", admtext, sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
					}
				}
			}
		}
		return 1;
	}
Anybody who has a idea whats wrong here?

THANKS !


Re: Small problem with /admins - ben1 - 29.12.2009

pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
    {
    if(IsPlayerConnected(playerid))
      {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "|____ Online IBP Admins ____|");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                  if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
                  {
                    new admtext[64];
                        if (PlayerInfo[playerid][pAdmin] = 1) { admtext = "Moderator"; }
                        else if (PlayerInfo[playerid][pAdmin] = 2) { admtext = "Admin"; }
                      else if (PlayerInfo[playerid][pAdmin] >= 3) { admtext = "Lead Admin"; }
                        else { admtext = "Moderator"; }
                        GetPlayerName(i, sendername, sizeof(sendername));
                        if(AdminDuty[i] == 0)
                        {
                            format(string, 256, "%s: %s", admtext, sendername);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                        }
                        else
                        {
                          format(string, 256, "%s: %s (on duty)", admtext, sendername);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                        }
                    }
                }
            }
        }
        return 1;
    }
there you go


Re: Small problem with /admins - KnooL - 29.12.2009

Quote:
Originally Posted by ben1
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
  if(IsPlayerConnected(playerid)) {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "|____ Online IBP Admins ____|");
    for(new i = 0; i < MAX_PLAYERS; i++) {
      if(IsPlayerConnected(i)) {
        if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338) {
          new admtext[64];
          if (PlayerInfo[playerid][pAdmin] = 1) { admtext = "Moderator"; }
          else if (PlayerInfo[playerid][pAdmin] = 2) { admtext = "Admin"; }
          else if (PlayerInfo[playerid][pAdmin] >= 3) { admtext = "Lead Admin"; }
          else { admtext = "Moderator"; }
          GetPlayerName(i, sendername, sizeof(sendername));
          if(AdminDuty[i] == 0) {
            format(string, 256, "%s: %s", admtext, sendername);
            SendClientMessage(playerid, COLOR_WHITE, string);
          }
          else {
            format(string, 256, "%s: %s (on duty)", admtext, sendername);
            SendClientMessage(playerid, COLOR_WHITE, string);
          }
        }
      }
    }
  }
  return 1;
}
corrected identation