Raised This Month: $ Target: $400
 0% 

Problem of Showing admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 07-31-2009 , 04:58   Problem of Showing admins
Reply With Quote #1

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!?
At last sorry for my bad english.

Last edited by edward0810; 07-31-2009 at 05:02.
edward0810 is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 08-04-2009 , 12:22   Re: Problem of Showing admins
Reply With Quote #2

Can anyone solve this problem?? I think it's easy to code experts. Bump!
__________________
I am a newbie. Don't blame for my stupid question
edward0810 is offline
Demigod90
Junior Member
Join Date: Jul 2009
Location: Illinois, USA
Old 08-05-2009 , 23:04   Re: Problem of Showing admins
Reply With Quote #3

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++
Attached Files
File Type: sma Get Plugin or Get Source (admindisplay.sma - 492 views - 2.7 KB)
__________________

REP++
If you found this post helpful!

Demigod1990 <- Try my BRUTE!
Demigod90 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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