SA-MP Forums Archive
[Ajuda] /admins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] /admins (/showthread.php?tid=513668)



/admins - GHLEMES - 17.05.2014

Galera to com um problema no meu /admins.

Code:
pawn Код:
// This command lists all online admins
COMMAND:admins(playerid, params[])
{
    SendAdminText(playerid, "/admins", params);
    // Setup local variables
    new AdminList[500], Name[24];

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Scan through all players
        for (new i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                // Check if this player is an RCON admin
                if (IsPlayerAdmin(i))
                {
                    // Add all admin players to the list
                    format(AdminList, sizeof(AdminList), "%s %s{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n",AdminLevelName[APlayerData[i][PlayerLevel]], AdminList, Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                    // Re-start the for loop (skipping the remaining code for this iteration)
                    continue;
                }

                //Check if that player is an admin (using the PlayerLevel)
                if (APlayerData[i][PlayerLevel] > 0)
                {
                    // Add all admin players to the list
                    format(AdminList, sizeof(AdminList), "%s{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n", AdminList, Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                }
            }
        }

        // Check if there were admin-names added to the list
        if (strlen(AdminList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "Administradores Online:", AdminList, "Fechar", "");
        else
            SendClientMessage(playerid, 0xFF0000FF, "{B0C4DE}Administraзгo offline no momento !"); // No admins are online
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
Quando eu dou /admins sу o Primeiro aparece o Nivel. Exemplo:
Admins Online
Dono Nick (ID) Level
Nick (ID) Level
Nick (ID) Level

Sу no primeiro aparece o nome.

Base do GM: PPC_Trucking

Alguem ajuda?


Re: /admins - CrazyHelp - 17.05.2014

pawn Код:
COMMAND:admins(playerid, params[])
{
    // Setup local variables
    new AdminList[500], Name[24];

    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/admins", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Scan through all players
        for (new i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                // Check if this player is an RCON admin
                if (IsPlayerAdmin(i))
                {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (ID: %i), Nivel: %i \n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                    // Re-start the for loop (skipping the remaining code for this iteration)
                    continue;
                }

                //Check if that player is an admin (using the PlayerLevel)
                if (APlayerData[i][PlayerLevel] > 0)
                {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (id: %i), level-Admin: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                }
            }
        }

        // Check if there were admin-names added to the list
        if (strlen(AdminList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Admins Online:", AdminList, "OK", "Cancel");
        else
            SendClientMessage(playerid, 0xFF0000FF, "Nao tem Admins online"); // No admins are online
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}



Re: /admins - GHLEMES - 17.05.2014

Quote:
Originally Posted by CrazyHelp
Посмотреть сообщение
pawn Код:
COMMAND:admins(playerid, params[])
{
    // Setup local variables
    new AdminList[500], Name[24];

    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/admins", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Scan through all players
        for (new i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                // Check if this player is an RCON admin
                if (IsPlayerAdmin(i))
                {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (ID: %i), Nivel: %i (Scripter/Dono TOM)\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                    // Re-start the for loop (skipping the remaining code for this iteration)
                    continue;
                }

                //Check if that player is an admin (using the PlayerLevel)
                if (APlayerData[i][PlayerLevel] > 0)
                {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (id: %i), level-Admin: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                }
            }
        }

        // Check if there were admin-names added to the list
        if (strlen(AdminList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Admins Online:", AdminList, "OK", "Cancel");
        else
            SendClientMessage(playerid, 0xFF0000FF, "Nao tem Admins online"); // No admins are online
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
Resolvido, Muito obrigado e +REP


Re: /admins - Fenix4000 - 17.05.2014

Quote:
Originally Posted by CrazyHelp
Посмотреть сообщение
pawn Код:
COMMAND:admins(playerid, params[])
{
    // Setup local variables
    new AdminList[500], Name[24];

    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/admins", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Scan through all players
        for (new i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                // Check if this player is an RCON admin
                if (IsPlayerAdmin(i))
                {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (ID: %i), Nivel: %i (Scripter/Dono TOM)\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                    // Re-start the for loop (skipping the remaining code for this iteration)
                    continue;
                }

                //Check if that player is an admin (using the PlayerLevel)
                if (APlayerData[i][PlayerLevel] > 0)
                {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (id: %i), level-Admin: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                }
            }
        }

        // Check if there were admin-names added to the list
        if (strlen(AdminList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Admins Online:", AdminList, "OK", "Cancel");
        else
            SendClientMessage(playerid, 0xFF0000FF, "Nao tem Admins online"); // No admins are online
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
ehueheuehu pego o comando ja pronto do gm TRUCK L1F3 '---'