Quote:
Originally Posted by Doc-Holiday
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(iPlayers, iPlayersNum); //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=0; i < iPlayersNum; i++)
{
get_user_name(iPlayers[i], szName, charsmax(szName));
client_print(id, print_chat, "[AMXX] Name: %s Rank: %s", szName, AccessType[RankName[iPlayers[i]]]);
}
}
|
PHP Code:
public cmdAdminsOnline(id)
{
new iPlayers[32], iPlayersNum;
get_players(iPlayers, iPlayersNum);
new szName[32];
get_pcvar_string(TAG, PREFIX, charsmax(PREFIX));
for(new i=0; i < iPlayersNum; i++)
{
get_user_name(iPlayers[i], szName, charsmax(szName));
client_printc(id, "!g[%s]!n %s(!g%s!n) ", PREFIX, szName, AccessType[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?