Raised This Month: $ Target: $400
 0% 

[SOLVED] custom /admins "online" ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 02-23-2013 , 17:55   Re: custom /admins "online" ?
Reply With Quote #3

Quote:
Originally Posted by Doc-Holiday View Post
hook the command that you want to use.. then loop through the players on the server... get_players method works well..

If you want to display something like this
Code:
[AMXX] Name: SavSin    Rank: Manager
PHP Code:
public cmdAdminsOnline(id)
{
    new 
iPlayers[32], iPlayersNum;
    
get_players(iPlayersiPlayersNum); //iPlayers is an array which holds the player id's of the only line players. iPlayersNum is number of players playing.
                                                        //if iPlayersNum was 5 then iPlayers would hold the id's for those players in cell's 0-4
    
new szName[32];
    
    for(new 
i=0iPlayersNumi++)
    {
        
get_user_name(iPlayers[i], szNamecharsmax(szName));
        
client_print(idprint_chat"[AMXX] Name: %s Rank: %s"szNameAccessType[RankName[iPlayers[i]]]);
    }

PHP Code:
public cmdAdminsOnline(id)
{
    new 
iPlayers[32], iPlayersNum;
    
get_players(iPlayersiPlayersNum);
    new 
szName[32];
    
    
get_pcvar_string(TAGPREFIXcharsmax(PREFIX));
    
    for(new 
i=0iPlayersNumi++)
    {
        
get_user_name(iPlayers[i], szNamecharsmax(szName));
        
client_printc(id"!g[%s]!n %s(!g%s!n) "PREFIXszNameAccessType[RankName[iPlayers[i]]]);
    }

works... but was hoping to display like this..

[PREFIX] Admins Online: Name1 (Rank), Name2 (Rank), Name3 (Rank), etc etc

and if g_HideRank is true then to only show admins who have NOT chosen to hide rank...

this explanation make sense?
Blizzard_87 is offline
 



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 21:47.


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