Como puedo hacer una segunda linea de esto?
#1

pawn Код:
if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators jugando ni conectados");

    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;
}
Cuando hay muchos admins conectados la linea sigue y sigue y no va otra linea (en el juego) , entonces lo que quiero hacer es ponerlos en dialogo o podre agregar mas de 2 lineas

PD: Es del ladmin4v2
Reply
#2

Mucho codigo para una simple funciуn. Toma, te dejo el mio
pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new conteo, admins[1500],texto[128],titulo[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i))
    {
    conteo++;
    }
    else if(PlayerInfo[i][Level] >= 1)
    {
    conteo++;
    }
    }
    if(conteo == 0)return SendClientMessage(playerid,COLOR_ROJO,"No ay administradores conecatados...");
    format(titulo,128,"Admins Conectados: {FFFFFF}%d",conteo);
    //Se contaron los admins conectados

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i))
    {
    //Si el player es admin RCON...
    format(texto,128,"{FFFFFF}%s [%d] [Nivel]: {FF0033}RCON\n",PlayerName(i),i);
    strcat(admins,texto);
    }
    else if(PlayerInfo[i][Level] >= 1)
    {
    //Si no es RCON pero si admin normal...
    format(texto,128,"{FFFFFF}%s [%d] [Nivel]: {FF0033}%d\n",PlayerName(i),i,PlayerInfo[i][Level]);
    strcat(admins,texto);
    }
    }
    ShowPlayerDialog(playerid,78,DIALOG_STYLE_MSGBOX,titulo,admins,"Cerrar","");
    return 1;
}
EDIT: Tenia un error el codigo, ya que lo converti de mi sistema de admin al de ladmin, pero funcionara perfecto
NOTA: Se muestran en un dialogo, como titulo se pone cuantos administradores hay y en el contenido cuales estan
Reply
#3

Quote:
Originally Posted by josta
Посмотреть сообщение
Mucho codigo para una simple funciуn. Toma, te dejo el mio
pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new conteo, admins[1500],texto[128],titulo[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i))
    {
    conteo++;
    }
    else if(PlayerInfo[i][Level] >= 1)
    {
    conteo++;
    }
    }
    if(conteo == 0)return SendClientMessage(playerid,COLOR_ROJO,"No ay administradores conecatados...");
    format(titulo,128,"Admins Conectados: {FFFFFF}%d",conteo);
    //Se contaron los admins conectados

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i))
    {
    //Si el player es admin RCON...
    format(texto,128,"{FFFFFF}%s [%d] [Nivel]: {FF0033}RCON\n",PlayerName(i),i);
    strcat(admins,texto);
    }
    else if(PlayerInfo[i][Level] >= 1)
    {
    //Si no es RCON pero si admin normal...
    format(texto,128,"{FFFFFF}%s [%d] [Nivel]: {FF0033}%d\n",PlayerName(i),i,PlayerInfo[i][Level]);
    strcat(admins,texto);
    }
    }
    ShowPlayerDialog(playerid,78,DIALOG_STYLE_MSGBOX,titulo,admins,"Cerrar","");
    return 1;
}
EDIT: Tenia un error el codigo, ya que lo converti de mi sistema de admin al de ladmin, pero funcionara perfecto
NOTA: Se muestran en un dialogo, como titulo se pone cuantos administradores hay y en el contenido cuales estan
pawn Код:
C:\Users\MORENO\Desktop\Josй\-Server Dm 0.3c-\filterscripts\ladmin4v2.pwn(736) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Users\MORENO\Desktop\Josй\-Server Dm 0.3c-\filterscripts\ladmin4v2.pwn(849) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Users\MORENO\Desktop\Josй\-Server Dm 0.3c-\filterscripts\ladmin4v2.pwn(3249) : error 017: undefined symbol "PlayerName"
C:\Users\MORENO\Desktop\Josй\-Server Dm 0.3c-\filterscripts\ladmin4v2.pwn(3255) : error 017: undefined symbol "PlayerName"
Reply
#4

pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new conteo, admins[1500],texto[128],titulo[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i))
    {
    conteo++;
    }
    else if(PlayerInfo[i][Level] >= 1)
    {
    conteo++;
    }
    }
    if(conteo == 0)return SendClientMessage(playerid,COLOR_ROJO,"No ay administradores conecatados...");
    format(titulo,128,"Admins Conectados: {FFFFFF}%d",conteo);
    //Se contaron los admins conectados

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i))
    {
    //Si el player es admin RCON...
    format(texto,128,"{FFFFFF}%s [%d] [Nivel]: {FF0033}RCON\n",PlayerName2(i),i);
    strcat(admins,texto);
    }
    else if(PlayerInfo[i][Level] >= 1)
    {
    //Si no es RCON pero si admin normal...
    format(texto,128,"{FFFFFF}%s [%d] [Nivel]: {FF0033}%d\n",PlayerName2(i),i,PlayerInfo[i][Level]);
    strcat(admins,texto);
    }
    }
    ShowPlayerDialog(playerid,78,DIALOG_STYLE_MSGBOX,titulo,admins,"Cerrar","");
    return 1;
}
Reply
#5

Muchas Gracias
+Reputation : x
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)