help me
#3

pawn Код:
COMMAND:admins(playerid, params[])
{
    if (playerData[playerid][playerScore] < 1000) return SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must have at-least 1000 score to view the admin list.");

    new string[828];
    for(new i; i < MAX_PLAYERS; i++)//Use foreach or "GetPlayerPoolSize (0.3.7)" instead
    {
        if(IsPlayerConnected(i) && playerData[i][AHide] == 0)
        {
            switch(playerData[i][playerLevel])
            {
                case 1: format(string, sizeof(string), "%s%s(%i) - Moderator\n", string, playerData[i][tempAdminName], i);
                case 2..7: format(string, sizeof(string), "%s%s(%i) - Administrator\n", string, playerData[i][tempAdminName], i);
                default: continue;
            }
        }
    }
    if(strlen(string)) ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "OK", "");
    else ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "There are no administrators present.", "OK", "");

    return 1;
}
There are better ways, but this should do the job.
Reply


Messages In This Thread
help me - by PowerF - 15.09.2015, 09:29
Re: help me - by Darrenr - 15.09.2015, 09:46
Re: help me - by xVIP3Rx - 15.09.2015, 10:32

Forum Jump:


Users browsing this thread: 1 Guest(s)