[Include] [INC]HighestTopList Updated 04.07
#1

Toplist function:
Admins command:
pawn Code:
new
    Admin_Rank[][] = {"New Admin", "Admin Cadet", "Moderator", "Administrator", "Head Administrator" };
   
COMMAND:admins(playerid,params[])
{
    #define TOPLINE 10 // Edited max top line
    new
        Count,
        Player_ID[TOPLINE],
        Top_Info[TOPLINE];

    foreach(Player, forplayerid)
//  for(new forplayerid, max_players = GetMaxPlayers(); forplayerid < max_players; forplayerid++)
    {
//    if(!IsPlayerConnected(forplayerid)) continue;
        if(PlayerInfo[forplayerid][Level] < 1) continue;
        HighestTopList(forplayerid, PlayerInfo[forplayerid][Level], Player_ID, Top_Info, TOPLINE);
        Count++;
    }
    SendClientMessage(playerid, 0xFFFFFFAA, " [  ¤¤¤¤¤ Online Admins: ¤¤¤¤¤¤  ] ");
    if(Count)
    {
        new
            string[128];
        for(new i = 0; i < TOPLINE; i++)
        {
            if(Top_Info[i] <= 0) continue;
            format(string, sizeof string, " >< %s ID:%d | Level: %d | %s", pName(Player_ID[i]), Player_ID[i], Top_Info[i], Admin_Rank[Top_Info[i]-1]);
            SendClientMessage(playerid, 0x0099FFAA, string);
        }
    } else {
        SendClientMessage(playerid, 0x0099FFAA, "No Administrator Online");
    }
    #undef TOPLINE
    return 1;
}
Richlist command:
pawn Code:
COMMAND:richlist(playerid,params[])
{
    #define TOPLINE 10
    new
        Player_ID[TOPLINE],
        Top_Info[TOPLINE];

    foreach(Player, i)
//  for(new i, max_players = GetMaxPlayers(); i < max_players; i++)
    {
//      if(!IsPlayerConnected(i)) continue;
        HighestTopList(i, GetPlayerMoney(i), Player_ID, Top_Info, TOPLINE);
    }

    SendClientMessage(playerid, 0xFFFFFFAA, "Rich List:");

    new
        string[128];
    for(new i; i < TOPLINE; i++)
    {
        if(Top_Info[i] <= 0) continue;
        format(string, sizeof string, " %s ID:%d - $%d", pName(Player_ID[i]), Player_ID[i], Top_Info[i]);
        SendClientMessage(playerid, 0xFFFFFFAA, string);
    }
    #undef TOPLINE
    return 1;
}
GetPlayerName function by DracoBlue
Code:
stock pName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  return name;
}
Download:

Reply


Messages In This Thread
[INC]HighestTopList Updated 04.07 - by smeti - 06.04.2010, 11:26
Re: [INC]HighestTopList - by ineoncore - 06.04.2010, 12:02
Re: [INC]HighestTopList - by Lorenc_ - 06.04.2010, 12:47
Re: [INC]HighestTopList - by smeti - 06.04.2010, 13:18
Re: [INC]HighestTopList - by ziomal432 - 06.04.2010, 13:42
Re: [INC]HighestTopList - by Zh3r0 - 06.04.2010, 14:14
Re: [INC]HighestTopList - by XRVX - 06.04.2010, 14:16
Re: [INC]HighestTopList - by smeti - 06.04.2010, 17:25
Re: [INC]HighestTopList - by aircombat - 06.04.2010, 19:28
Re: [INC]HighestTopList - by dnsdj - 07.04.2010, 03:37

Forum Jump:


Users browsing this thread: 1 Guest(s)