[Ajuda] Problemas ao /admins
#1

No meu GM de Caminhoneiro, apуs eu entrar no servidor, logar na rcon e executar "/Admins" aparece Feliphe_Mort [ID: 0] (Level: 0), E percebo que isso Sу acontece quando estou logado na rcon... Oque pode ser? Alguem ajuda?

Code:

pawn Код:
COMMAND:setlevel(playerid, params[])
{
    new OtherPlayer, Level, Msg[128], Name[24], AdminName[24], OldLevel;
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (IsPlayerAdmin(playerid))
        {
            if (sscanf(params, "ui", OtherPlayer, Level)) SendClientMessage(playerid, 0xFF0000AA, "Use: /setlevel [id] [nivel]");
            else
            {
                if (IsPlayerConnected(OtherPlayer))
                {
                 OldLevel = APlayerData[OtherPlayer][PlayerLevel];
                    GetPlayerName(playerid, AdminName, sizeof(AdminName));
                    GetPlayerName(OtherPlayer, Name, sizeof(Name));
                    APlayerData[OtherPlayer][PlayerLevel] = Level;
                    if (OldLevel != Level)
                    {
                        if (OldLevel < Level)
                            format(Msg, 128, "{FFFF00}[INFO] {32CD32}O Player %s foi promovido a %s por %s", Name, AdminLevelName[Level], AdminName);
                        if (OldLevel > Level)
                            format(Msg, 128, "{FFFF00}[INFO] {32CD32}O Player %s foi rebaixado a %s por %s", Name, AdminLevelName[Level], AdminName);
                        SendClientMessageToAll(0x00FF00FF, Msg);
                    }
                    else
                        SendClientMessage(playerid, 0xFF0000FF, "Level de Admin Nгo Setado.");
                }
                else
                 SendClientMessage(playerid, 0xFF0000FF, "Jogador Offline.");
            }
        }
        else
          return 0;
    }
    else
        return 0;
    return 1;
}
Reply
#2

Manda Seu /admins '-'
Reply
#3

Perdoe-me copiei o codigo errado :/

pawn Код:
// This command lists all online admins
COMMAND:admins(playerid, 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{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n", 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;
}
Reply
#4

PHP код:
COMMAND:admins(playeridparams[])
{
    new 
AdminList[500], Name[24];
    if(
APlayerData[playerid][LoggedIn] == true)
    {
        for (new 
iMAX_PLAYERSi++)
        {
            if (
IsPlayerConnected(i))
            {
                
GetPlayerName(iNamesizeof(Name));
                if (
APlayerData[i][PlayerLevel] > || IsPlayerAdmin(i))
                {
                    
format(AdminListsizeof(AdminList), "%s{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n"AdminListNameiAPlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                
}
            }
        }
        if (
strlen(AdminList) > 0)
            
ShowPlayerDialog(playeridDialogNoResponseDIALOG_STYLE_MSGBOX"Administradores Online:"AdminList"Fechar""");
        else
            
SendClientMessage(playerid0xFF0000FF"{B0C4DE}Administraзгo offline no momento !"); // No admins are online
    
}
    else
        return 
0;
    return 
1;

tenta :B
Reply
#5

Apуs logar rcon, continua aparecendo meu Nome.. e Level 0
Reply
#6

Jб foi resolvido colega, obrigado mesmo assim.

Apenas removi a linha:

pawn Код:
// Check if this player is an RCON admin
                if (IsPlayerAdmin(i))
                {
                    // 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
                    // Re-start the for loop (skipping the remaining code for this iteration)
                    continue;
                }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)