[Ajuda] Numero de administrador online no cmd /admins
#1

Bom o CMD que elaborei para meu FS estб bбsico mostrando somente os VIPS e Administradores online no servidor... Tentei colocar em cima Administradores Onlines: 5 (Exemplo), Sempre da um errinho chato no Connect e jб tentei de varias formas e nada =/, alguem pode colocar sa porra no cmd pramin?

pawn Код:
CMD:admins(playerid, params[])
{
    new DialogAdminsMort[1200];
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerDados[i][Escondido] == false)
            {
                if(PlayerDados[i][Admin] == 2) AdminNivel = "2";
                if(PlayerDados[i][Admin] == 3) AdminNivel = "3";
                if(PlayerDados[i][Admin] == 4) AdminNivel = "4";
                if(PlayerDados[i][Admin] == 5) AdminNivel = "5";
                if(PlayerDados[i][Escondido] == false)
                {
                    if(PlayerDados[i][Admin] == 1) // ADMINS VIP
                    {
                        format(String, 300, "   {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [VIP]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
                        strcat(DialogAdminsMort, String);
                        continue;
                    }
                    if(PlayerDados[i][Admin] > 1)
                    {
                        format(String, 300, "   {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [Nнvel: %s]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
                        strcat(DialogAdminsMort, String);
                    }
                }
            }
        }
    }
    if (strlen(DialogAdminsMort) > 0)
        ShowPlayerDialog(playerid, 9000, DIALOG_STYLE_MSGBOX, "{FF0000}Administradores/Vips Onlines", DialogAdminsMort, "Fechar", ""); // Depois Mude se quiser ^^
    else
        SendClientMessage(playerid, BRANCO, "{B0C4DE}Administraзгo offline no momento !"); // No admins are online

    return true;
}
Desde jб grato!
Reply
#2

Cria uma variбvel de contador exemplo: new count;

E incrementa ela depois do for: count++

Fazendo isso, vocк terб a variбvel count o nъmero de membros online. Depois й sу utilizar ela
Reply
#3

Quote:
Originally Posted by Joao Pedro
Посмотреть сообщение
Cria uma variбvel de contador exemplo: new count;

E incrementa ela depois do for: count++

Fazendo isso, vocк terб a variбvel count o nъmero de membros online. Depois й sу utilizar ela
Nгo seria incrementado depois do if(PlayerDados[i][Admin] == ValorDoNivelDoCondenado ) ?
Reply
#4

E isso nгo fica a baixo do looping for
Reply
#5

Jб tentei fazer isso, mais ao testar sempre aparece "Administradores Online: " ou "Administradores Online: 0"

Podes deixa isso pronto, to meio irritado com o mesmo!
Reply
#6

Pronto? Negativo.
Reply
#7

Como o joгo disse faz a variavel contando ^^

pawn Код:
CMD:admins(playerid, params[])
{
    new
        DialogAdminsMort[ 1200 ],
        count = 0;
    ;

    for(new i = 0; i <= GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerDados[i][Admin] >= 1)
            {
                switch(PlayerDados[i][Admin]){
                    case 2: AdminNivel = "2";
                    case 3: AdminNivel = "3";
                    case 4: AdminNivel = "4";
                    case 5: AdminNivel = "5";
                }
                if(PlayerDados[i][Escondido] == false)
                {
                    if(PlayerDados[i][Admin] == 1)
                    {
                        format(String, 300, "   {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [VIP]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
                        strcat(DialogAdminsMort, String);
                    }
                    if(PlayerDados[i][Admin] > 1)
                    {
                        format(String, 300, "   {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [Nнvel: %s]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
                        strcat(DialogAdminsMort, String);
                    }
                }
                count++;
            }
        }
    }
    if(count > 0)
        ShowPlayerDialog(playerid, 9000, DIALOG_STYLE_MSGBOX, "{FF0000}Administradores/Vips Onlines", DialogAdminsMort, "Fechar", ""); // Depois Mude se quiser ^^
    else
        SendClientMessage(playerid, BRANCO, "{B0C4DE}Administraзгo offline no momento !"); // No admins are online

    return true;
}
Reply
#8

Tentei uma coisa e deu um pouco mais de resultado...
Reply
#9

Quote:
Originally Posted by feliphemort
Посмотреть сообщение
Tentei uma coisa e deu um pouco mais de resultado...
a minha estб correta filho ^^
Reply
#10

Resolvido, obrigado a todos!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)