[Ayuda] Comandos /admins En Dialog
#1

Hola gente, Quisiera hacer este comando que muestra Los Admins On-Line, pero en dialog, he intentado de todo, pero sale mal, o no funciona, Haber si alguien de ustedes me podrб Ayuda.
Aqui esta el Codigo:

pawn Код:
dcmd_admins(playerid,params[]) {
    #pragma unused params
    new Count[2], i, string[128];
    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
    {
        if(PlayerInfo[i][Level] > 0) Count[0]++;
        if(IsPlayerAdmin(i)) Count[1]++;
    }

    #if defined HIDE_ADMINS
    if(PlayerInfo[playerid][Level] == 0) {
        if(Count[0] >= 1) {
            format(string, sizeof(string), "Hay %d Administradores en linea. Use /report <id> <razon> si encuentra a un jugador usando cheats", Count[0]);
            return SendClientMessage(playerid, blue, string);
        } else return SendClientMessage(playerid, blue, "No hay ningun Administrador en linea");
    }
    #endif

    if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators online");

    if(Count[0] == 1) {
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0) {
    format(string, sizeof(string), "Administradores: (%d)%s [%d]", i, PlayerName2(i), PlayerInfo[i][Level] ); SendClientMessage(playerid, blue, string);
        }
    }

    if(Count[0] > 1) {
        new x; format(string, sizeof(string), "Administradores: ");
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0)
        {
            format(string,sizeof(string),"%s(%d)%s [%d]",string,i,PlayerName2(i),PlayerInfo[i][Level]);
            x++;
            if(x >= 5) {
                SendClientMessage(playerid, blue, string); format(string, sizeof(string), "Administradores: "); x = 0;
            }
            else format(string, sizeof(string), "%s,  ", string);
        }
        if(x <= 4 && x > 0) {
            string[strlen(string)-3] = '.';
            SendClientMessage(playerid, blue, string);
        }
    }

    if( (Count[1] == 1) && (PlayerInfo[playerid][Level] > 0) ) {
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
            format(string, sizeof(string), "Administradores RCON: (%d)%s", i, PlayerName2(i)); SendClientMessage(playerid, COLOR_WHITE, string);
        }
    }
    if(Count[1] > 1) {
        new x; format(string, sizeof(string), "Administradores RCON: ");
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            format(string,sizeof(string),"%s(%d)%s",string,i,PlayerName2(i));
            x++;
            if(x >= 5) {
                SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "Administradores RCON: "); x = 0;
            }
            else format(string, sizeof(string), "%s,  ", string);
        }
        if(x <= 4 && x > 0) {
            string[strlen(string)-3] = '.';
            SendClientMessage(playerid, COLOR_WHITE, string);
        }
    }
    return 1;
}
Espero Que me Puedan Ayudar
Reply
#2

Bueee poner cosa x cosa tengo sueсo xD
Te dejo el code y ponelo vos :P
pawn Код:
dcmd_admins(playerid,params[]) {
#pragma unused params
new Admins[128];
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
format(Admins, sizeof(Admins), "Administradores conectados\n\tNick: %s | Nivel: %d", PlayerName2(i),PlayerInfo[i][Level]);
ShowPlayerDialog(playerid, 9977, DIALOG_STYLE_MSGBOX, "Administradores Online:", Admins, "Ok", "");
// Cambia el dialog ID 9977 x el que vos quieras.
}
}
return 1;
}
Reply
#3

Disculpa, no manejo mucho la estructura for, y disculpa si estoy mal pero, en el codigo, el dialogo no saldria en cada vuelta de la estructura, y pararia hasta que la condiciуn del for sea falsa?
Reply
#4

Lo probaste como te lo dн?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)