[help] Helpers/Admins list
#5

pawn Код:
// The command "/admins".
CMD:admins(playerid, params[])
{
        new count = 1, string[828];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && adminLevel[i] >= 1)
            {
                // String
                format(string, sizeof(string), "%s(%i) - Admin Level: %i\n",PlayerName(i), i, adminLevel[i]);
                count ++;
            }
        }

        if(count != 1)
        {
            // Shows the admins that are present
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "Close", "");
        }
        else
        {
            // No admins online
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "{FFFFFF}There are no administrators online at the moment.", "OK", "");
        }
    }
    return 1;
}
// The command "/helpers".
CMD:helpers(playerid, params[])
{
        new count = 1, string[828];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && helperLevel[i] >= 1)
            {
                // String
                format(string, sizeof(string), "%s(%i) - Helper Level: %i\n",PlayerName(i), i, helperLevel[i]);
                count ++;
            }
        }

        if(count != 1)
        {
            // Shows the helpers that are present
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Helpers", string, "Close", "");
        }
        else
        {
            // No helpers online
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Helpers", "{FFFFFF}There are no helpers online at the moment.", "OK", "");
        }
    }
    return 1;
}
Do not forget to change the variables, the dialog IDs, all that.
Reply


Messages In This Thread
[help] Helpers/Admins list - by Arxalan - 25.12.2014, 15:56
Re: [help] Helpers/Admins list - by MrCallum - 25.12.2014, 16:01
Re: [help] Helpers/Admins list - by Arxalan - 25.12.2014, 16:14
Re: [help] Helpers/Admins list - by MrCallum - 25.12.2014, 16:19
Re: [help] Helpers/Admins list - by iFiras - 25.12.2014, 16:26
Re: [help] Helpers/Admins list - by Kyance - 25.12.2014, 16:31
Re: [help] Helpers/Admins list - by zT KiNgKoNg - 25.12.2014, 17:36

Forum Jump:


Users browsing this thread: 1 Guest(s)