I am having troubles making an /admins command.
#2

Код:
if(strcmp(cmd, "/admins", true) == 0) // If the player types /admins...
{
    new playername[32]; // Create a new string where the players name will be stored
    new string[64]; // Creates a new string where the message will be stored
    SendClientMessage(playerid, COLOR_WHITE, "Admins online:"); // Sends the beginning text "Admins online:"
    for(new i = 0; i < MAX_PLAYERS; i++) // Creates a loop which runs for every player on the server
    {
        if(PlayerInfo[i][pAdmin] > 0) // If the players level is above 0.. you must replace this with whatever your definition as an admin
        {
            GetPlayerName(i, playername, sizeof(playername)); // Store the players name under 'playername'
            format(string, sizeof(string), "Admin: %s, Level: %d", playername, PlayerInfo[i][pAdmin]); // Add a new message which contains the players name and level
            SendClientMessage(playerid, COLOR_GREY, string); // Sends the message to the player
        }
    }
}
hopefully this will help you
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)