[Ajuda] Comando /admins
#1

Olб meu comando /admins nao esta funcionando:
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), Level de admin: %i (RCON admin)\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 de 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", "Cancelar");
        else
            SendClientMessage(playerid, 0xFF0000FF, "[MDC] Nгo tem admins online!"); // No admins are online
    }
    else
        return 0;

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

Quando eu digito da ServerUnckwonCommand
Reply
#2

Porque voce tem la em baixo return 0; e return 1; ?

Nao seria apenas um dos dois ?
Reply
#3

Quote:
Originally Posted by N3XTMapper
Посмотреть сообщение
Porque voce tem la em baixo return 0; e return 1; ?

Nao seria apenas um dos dois ?
Slб num manjo... por isso busquei ajuda
Reply
#4

Tente tirar um dos dois returns
Reply
#5

Quote:
Originally Posted by N3XTMapper
Посмотреть сообщение
Tente tirar um dos dois returns
Nao adianto nada.. quando n tem admins fala que nao tem quando tem da serverunkwoncommand
Reply
#6

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), Level de admin: %i (RCON admin)\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)
                }

                //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 de 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", "Cancelar");
        else SendClientMessage(playerid, 0xFF0000FF, "[MDC] Nгo tem admins online!"); // No admins are online
    }
    // Let the server know that this was a valid command
    return 1;
}
Reply
#7

ClanDok nгo ta nem tentando fazer o code, sу pega e ve que da errado, nгo tenta procurar uma soluзгo '-' tsc
Reply
#8

Parei no "meu comando" rss
Reply
#9

Bem, vocк estб com admin no servidor?
Se sim, vб setando seu level de admin, aos poucos.
Esse gamemode й legal, porйm tem que ter umas noзхes.

"Por que alterar o nнvel admin?"

Simplesmente, vocк pode estar com nivel acima que o definido.

Exemplo: Mбximo do PPC_Trucking mesmo se nгo me engano, й level 5.
Se vocк estiver com level 6, darб este problema.

Reply
#10

Quote:
Originally Posted by Nickvj7
Посмотреть сообщение
Bem, vocк estб com admin no servidor?
Se sim, vб setando seu level de admin, aos poucos.
Esse gamemode й legal, porйm tem que ter umas noзхes.

"Por que alterar o nнvel admin?"

Simplesmente, vocк pode estar com nivel acima que o definido.

Exemplo: Mбximo do PPC_Trucking mesmo se nгo me engano, й level 5.
Se vocк estiver com level 6, darб este problema.

Qualquer player tenta fazer o command da isso aew vao codigo dnv..
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), Level de admin: %i (RCON admin)\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 de 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", "Cancelar");
        else
            SendClientMessage(playerid, 0xFF0000FF, "[MDC] Nгo tem admins online!"); // No admins are online
    }
    else
        return 0;

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


Forum Jump:


Users browsing this thread: 1 Guest(s)