AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem of Showing admins (https://forums.alliedmods.net/showthread.php?t=98952)

edward0810 07-31-2009 04:58

Problem of Showing admins
 
So this time i have a plugin which has no compiling problem but it doesn't works fine. Anyway, plugin first:
Code:
#include <amxmodx> #include <amxmisc> new ranr new rang new ranb public plugin_init() {  register_plugin("Admin HUD List","1.0","Don't know")  register_clcmd("say /admin","clcmd_admins",-1," - Shows The Online Admins In The Server")  ranr = random_num(0,255)  rang = random_num(0,255)  ranb = random_num(0,255) } public clcmd_admins(id) {  new adminlist[2048] = "Admins Currently Online^n"    new temp[64],adminnames[32],players[32],num,player,i  get_players(players,num)    for(i = 0;i < num;i++)  {   player = players[i]   if(is_user_connected(player) && (get_user_flags(player) & ADMIN_LEVEL_A))   {    get_user_name(player,adminnames,31)    format(temp,63,"【LV3 ADMIN】%s^n",adminnames)    add(adminlist,2047,temp)   }   new temp[64],adminnames[32],players[32],num,player,i   get_players(players,num)     for(i = 0;i < num;i++)   {    player = players[i]    if(is_user_connected(player) && (get_user_flags(player) & ADMIN_LEVEL_B))    {     get_user_name(player,adminnames,31)     format(temp,63,"【LV2 ADMIN】%s^n",adminnames)     add(adminlist,2047,temp)    }    new temp[64],adminnames[32],players[32],num,player,i    get_players(players,num)        for(i = 0;i < num;i++)    {     player = players[i]     if(is_user_connected(player) && (get_user_flags(player) & ADMIN_LEVEL_C))     {      get_user_name(player,adminnames,31)      format(temp,63,"【LV1 ADMIN】%s^n",adminnames)      add(adminlist,2047,temp)     }     new temp[64],adminnames[32],players[32],num,player,i     get_players(players,num)         for(i = 0;i < num;i++)     {      player = players[i]      if(is_user_connected(player) && (get_user_flags(player) & ADMIN_LEVEL_D))      {       get_user_name(player,adminnames,31)       format(temp,63,"【VIP】%s^n",adminnames)       add(adminlist,2047,temp)      }     }     if(strfind(adminlist,"-") == -1)     {      add(adminlist,2047,"")     }     set_hudmessage(ranr, rang, ranb, -1.0, 0.0, 2, 2.0, 6.0, 0.1, 0.1, 2)     show_hudmessage(id,adminlist)     return PLUGIN_HANDLED    }   }  }  return PLUGIN_HANDLED }



The problem is:
The higher lv admins' names have also been shown in the lower lv column. Let's say that abc is lv3 and the only admin in the server.Then when i say /admin, the hud message is like this:
Quote:

【LV3 ADMIN】
abc
【LV2 ADMIN】
abc
【LV1 ADMIN】
abc
【VIP】
abc
Who can fix this!?:shock:
At last sorry for my bad english.:wink:

edward0810 08-04-2009 12:22

Re: Problem of Showing admins
 
Can anyone solve this problem?? I think it's easy to code experts. Bump!

Demigod90 08-05-2009 23:04

Re: Problem of Showing admins
 
1 Attachment(s)
I believe I got it working to skip the admin from being listed in the lower list's by just checking if the user also has the higher admin power if so it skips it (aka: PLUGIN_CONTINUE).

The file(s) are attached so all you need to do is download it, and you can also check the sma file to see how I edited. If anyone has a better way to make this work than go ahead but this is the only way that I got it to work by testing by my self.

-If you find any issue's plz tell, and don't forget to REP++ :wink:


All times are GMT -4. The time now is 18:29.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.