[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
#2

Good job
Reply
#3

thats cool but some people use dcmd and strtok so maybe u could convert it to that just a opinion
Reply
#4

Quote:
Originally Posted by ((Lorenc))
thats cool but some people use dcmd and strtok so maybe u could convert it to that just a opinion


Convert:
zcmd:
pawn Code:
COMMAND:admins(playerid,params[]) {
dcmd:
pawn Code:
dcmd_admins(playerid,params[]) {
#pragma unused params

Reply
#5

Quote:

by ?

DracoBlue xD
Reply
#6

Quote:
Originally Posted by ziomal432
Quote:

by ?

DracoBlue xD
Who did you quoted there?...

Nice script dude
Reply
#7

looks nice
good work
Reply
#8

Quote:
Originally Posted by ziomal432
Quote:

by ?

DracoBlue xD
Thanks.
Reply
#9

nice work , 5/5 using it.
Reply
#10

nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)