[Ajuda] /Admins Crash
#1

@RESOLVIDO
Reply
#2

Mande o cуdigo.
Reply
#3

resolvido.
Reply
#4

A pasta "AUSENTES" existe na scriptfiles?
Reply
#5

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
A pasta "AUSENTES" existe na scriptfiles?
Siim
Reply
#6

Tente isso:
Код:
if(strcmp(cmd, "/admins", true) == 0)
{
    new PTstring[500], PTstr2[128], stringCargo[30], playerNome[MAX_PLAYER_NAME];

    for(new i = 0, mp = GetPlayerPoolSize(); i <= mp; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
        {
            if(HideAdm[i] != 0)
                continue;

            switch(PlayerInfo[i][pAdmin])
            {
                case 1: stringCargo = "Temporario";
                case 2: stringCargo = "Moderador";
                case 3: stringCargo = "Auxiliar";
                case 4: stringCargo = "Administrador";
                case 1337: stringCargo = "Master Editor";
                case 1338: stringCargo = "Responsavel Lider";
                case 1339: stringCargo = "Supervidor";
                case 1340: stringCargo = "Gerente";
                case 1341: stringCargo = "Sub Dono";
                case 1342: stringCargo = "Fundador";
                case 3000: stringCargo = "Resposavel Geral";

            }
            GetPlayerName(i, playerNome, sizeof(playerNome));

            if(away[i] == 0)
            {
                format(PTstr2, sizeof(PTstr2), "{FF69B4}%s {FFFFFF}- Cargo: {FF69B4}%s{FFFFFF} - Modo: %s", playerNome, stringCargo, admtrampando[i] == 1 ? ("{00B2EE} Trabalhando") : ("{32CD32} Jogando"));
                strcat(PTstring, PTstr2, sizeof(PTstring));
            }
            else
            {
                new datatext[129];
                format(datatext, sizeof(datatext), "AUSENTES/%s.txt",sendername);
                if(fexist(datatext))
                {
                    new File:handle = fopen(datatext, io_read), buf[128];
                    if(handle)
                    {
                        while(fread(handle, buf))
                        {
                            datatext = buf;
                        }
                        fclose(handle);
                    }

                }
                else
                {
                    datatext = "Sem Motivo";
                }
                format(PTstr2, sizeof(PTstr2), "{FF69B4}%s {FFFFFF}- Cargo: {FF69B4}%s{FFFFFF} - Modo:{FFFF00} Ausente{FFFFFF} - Motivo:{FFFF00} %s", playerNome, stringCargo, datatext);
                strcat(PTstring, PTstr2, sizeof(PTstring));
            }
        }
    }
    ShowPlayerDialog(playerid, 1999, DIALOG_STYLE_LIST, "{FF69B4}» {FFFFFF} Admins Online: {FF69B4} «", PTstring, "Ok", "");
    return 1;
}
Reply
#7

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Tente isso:
Код:
if(strcmp(cmd, "/admins", true) == 0)
{
    new PTstring[500], PTstr2[128], stringCargo[30], playerNome[MAX_PLAYER_NAME];

    for(new i = 0, mp = GetPlayerPoolSize(); i <= mp; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
        {
            if(HideAdm[i] != 0)
                continue;

            switch(PlayerInfo[i][pAdmin])
            {
                case 1: stringCargo = "Temporario";
                case 2: stringCargo = "Moderador";
                case 3: stringCargo = "Auxiliar";
                case 4: stringCargo = "Administrador";
                case 1337: stringCargo = "Master Editor";
                case 1338: stringCargo = "Responsavel Lider";
                case 1339: stringCargo = "Supervidor";
                case 1340: stringCargo = "Gerente";
                case 1341: stringCargo = "Sub Dono";
                case 1342: stringCargo = "Fundador";
                case 3000: stringCargo = "Resposavel Geral";

            }
            GetPlayerName(i, playerNome, sizeof(playerNome));

            if(away[i] == 0)
            {
                format(PTstr2, sizeof(PTstr2), "{FF69B4}%s {FFFFFF}- Cargo: {FF69B4}%s{FFFFFF} - Modo: %s", playerNome, stringCargo, admtrampando[i] == 1 ? ("{00B2EE} Trabalhando") : ("{32CD32} Jogando"));
                strcat(PTstring, PTstr2, sizeof(PTstring));
            }
            else
            {
                new datatext[129];
                format(datatext, sizeof(datatext), "AUSENTES/%s.txt",sendername);
                if(fexist(datatext))
                {
                    new File:handle = fopen(datatext, io_read), buf[128];
                    if(handle)
                    {
                        while(fread(handle, buf))
                        {
                            datatext = buf;
                        }
                        fclose(handle);
                    }

                }
                else
                {
                    datatext = "Sem Motivo";
                }
                format(PTstr2, sizeof(PTstr2), "{FF69B4}%s {FFFFFF}- Cargo: {FF69B4}%s{FFFFFF} - Modo:{FFFF00} Ausente{FFFFFF} - Motivo:{FFFF00} %s", playerNome, stringCargo, datatext);
                strcat(PTstring, PTstr2, sizeof(PTstring));
            }
        }
    }
    ShowPlayerDialog(playerid, 1999, DIALOG_STYLE_LIST, "{FF69B4}» {FFFFFF} Admins Online: {FF69B4} «", PTstring, "Ok", "");
    return 1;
}
Код:
(50017) : error 017: undefined symbol "GetPlayerPoolSize"
Reply
#8

Essa funзгo й da versгo 0.3.7, atualize a versгo ou substitua por GetMaxPlayers().
Reply
#9

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Essa funзгo й da versгo 0.3.7, atualize a versгo ou substitua por GetMaxPlayers().
Mudei, mas ainda continua crashando.
Reply
#10

Encontrei o erro, vocк esqueceu de pular a linha a cada novo administrador incluido, tente:
Код:
if(strcmp(cmd, "/admins", true) == 0)
{
    new PTstring[500], PTstr2[128], stringCargo[30], playerNome[MAX_PLAYER_NAME];

    for(new i = 0; i <= MaiorID; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
        {
            if(HideAdm[i] != 0)
                continue;

            switch(PlayerInfo[i][pAdmin])
            {
                case 1: stringCargo = "Temporario";
                case 2: stringCargo = "Moderador";
                case 3: stringCargo = "Auxiliar";
                case 4: stringCargo = "Administrador";
                case 1337: stringCargo = "Master Editor";
                case 1338: stringCargo = "Responsavel Lider";
                case 1339: stringCargo = "Supervidor";
                case 1340: stringCargo = "Gerente";
                case 1341: stringCargo = "Sub Dono";
                case 1342: stringCargo = "Fundador";
                case 3000: stringCargo = "Resposavel Geral";

            }
            GetPlayerName(i, playerNome, sizeof(playerNome));

            if(away[i] == 0)
            {
                format(PTstr2, sizeof(PTstr2), "{FF69B4}%s {FFFFFF}- Cargo: {FF69B4}%s{FFFFFF} - Modo: %s\n", playerNome, stringCargo, admtrampando[i] == 1 ? ("{00B2EE} Trabalhando") : ("{32CD32} Jogando"));
                strcat(PTstring, PTstr2, sizeof(PTstring));
            }
            else
            {
                new datatext[129];
                format(datatext, sizeof(datatext), "AUSENTES/%s.txt",sendername);
                if(fexist(datatext))
                {
                    new File:handle = fopen(datatext, io_read), buf[128];
                    if(handle)
                    {
                        while(fread(handle, buf))
                        {
                            datatext = buf;
                        }
                        fclose(handle);
                    }

                }
                else
                {
                    datatext = "Sem Motivo";
                }
                format(PTstr2, sizeof(PTstr2), "{FF69B4}%s {FFFFFF}- Cargo: {FF69B4}%s{FFFFFF} - Modo:{FFFF00} Ausente{FFFFFF} - Motivo:{FFFF00} %s\n", playerNome, stringCargo, datatext);
                strcat(PTstring, PTstr2, sizeof(PTstring));
            }
        }
    }
    ShowPlayerDialog(playerid, 1999, DIALOG_STYLE_LIST, "{FF69B4}» {FFFFFF} Admins Online: {FF69B4} «", PTstring, "Ok", "");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)