I need help getting the admin online totals
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
pawn Код:
for(new i=0; i<GetMaxPlayers(); i++)
{
    if(!IsPlayerConnected(i)) continue; // Not connected, continue
    if(!pLevel[i]) continue; // Not admin, continue
    if(!count) format(string, sizeof(string), "%s", pName[i]); // The first
    else format(string, sizeof(string), "\n%s", pName[i]); // Not the first, start with \n
    count++;
}
if(!count) return ShowPlayerDialog(.. no admins online ..); // No admins, display the 'no admins' dialog and stop the script there (return)
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Admins Online:", string, "OK", ""); // Script carried on, show list of admins
Rushed, should work though.
That won't work as intended, the end result will only be a single administrators name showing. This is because you're simply overwriting the string every time you format it, like I explained earlier, you should look into using strcat.
Reply


Messages In This Thread
I need help getting the admin online totals - by GAMER_PS2 - 21.10.2011, 11:41
Re: I need help getting the admin online totals - by JaTochNietDan - 21.10.2011, 11:46
Re: I need help getting the admin online totals - by GAMER_PS2 - 21.10.2011, 11:52
Re: I need help getting the admin online totals - by Ensconce - 21.10.2011, 12:55
Re: I need help getting the admin online totals - by MP2 - 21.10.2011, 13:30
Re: I need help getting the admin online totals - by JaTochNietDan - 21.10.2011, 13:52
Re: I need help getting the admin online totals - by MP2 - 21.10.2011, 14:12

Forum Jump:


Users browsing this thread: 1 Guest(s)