[Ajuda] waring sscanf
#1

eu vir uns waings na minha server.log

tambйm eu queria saber se de deixar esses bug o servidor reiniciava ou se acontecer alguns

PHP код:
[DtenHost-14:28:54] [CMD] [BVJ]McLouco_Moto (ID1digitou o comando ( /na a ).
[
DtenHost-14:28:54sscanf warningString buffer overflow.
DtenHost-14:27:00] [CMDprince_kay (ID8digitou o comando ( /cnnv quem quer ajuda ).
[
DtenHost-14:27:00sscanf warningString buffer overflow.
[
DtenHost-14:24:40] [CMD] [BVJ]Tayna_Kikut (ID11digitou o comando ( /soltar 8 ).
[
DtenHost-14:24:40sscanf warningString buffer overflow.
[
DtenHost-14:05:32] [CMDBrady_Erb (ID2digitou o comando ( /darestudo 2 5 ).
[
DtenHost-14:05:32sscanf warningString buffer overflow
achei outro bug eu acho quera isto que tava reiniciando meu server


pawn Код:
DtenHost-14:25:33] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-14:25:33] [debug]  Accessing element at negative index -400
[DtenHost-14:25:33] [debug] AMX backtrace:
[DtenHost-14:25:33] [debug] #0 00027c14 in public VeloDiego () from BEG2.amx
[DtenHost-14:25:34] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-14:25:34] [debug]  Accessing element at negative index -400
[DtenHost-14:25:34] [debug] AMX backtrace:
[DtenHost-14:25:34] [debug] #0 00027c14 in public VeloDiego () from BEG2.amx
[DtenHost-14:25:35] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-14:25:35] [debug]  Accessing element at negative index -400
[DtenHost-14:25:35] [debug] AMX backtrace:
[DtenHost-14:25:35] [debug] #0 00027c14 in public VeloDiego () from BEG2.amx
[DtenHost-14:25:37] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-14:25:37] [debug]  Accessing element at negative index -400
[DtenHost-14:25:37] [debug] AMX backtrace:
[DtenHost-14:25:37] [debug] #0 00027c14 in public VeloDiego () from BEG2.amx
[DtenHost-14:25:37] [chat] [Brady_Erb]: mc so tem vip pra vende ne ??
[DtenHost-14:25:37] [CMD] Jhonata_Oliveira (ID: 3) digitou o comando ( /praia ).
[DtenHost-14:25:38] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-14:25:38] [debug]  Accessing element at negative index -400
[DtenHost-14:25:38] [debug] AMX backtrace:
[DtenHost-14:25:38] [debug] #0 00027c14 in public VeloDiego () from BEG2.amx
[DtenHost-14:25:39] [CMD] G4NG573R (ID: 9) digitou o comando ( /procurado ).
[DtenHost-14:25:39] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-14:25:39] [debug]  Accessing element at negative index -400
[DtenHost-14:25:39] [debug] AMX backtrace:
[DtenHost-14:25:39] [debug] #0 00027c14 in public VeloDiego () from BEG2.amx

//===================================================================================
// Comandos

if(strcmp(cmd, "/na", true) == 0)
    {
        format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(dini_Int(file, "Profissao") == Ninja  || dini_Int(file, "aAdmin") == 1 || PlayerInfo[playerid][ZCON] == true)
        {
            new texto[128], msg[128];

            if(sscanf(cmdtext, "s[3]s[128]", cmd, texto))
            {
                SendClientMessage(playerid, Vermelho, "/na [texto]");
            }
            else
            {
                format(msg, sizeof(msg), "%s anuncia: %s", GetPlayerNameEx(playerid), texto);
                SendClientMessageToAll(C_Ninja, msg);
            }
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo tem permissгo.");
        }
        return 1;
    }

if(strcmp(cmd, "/soltar", true) == 0)
    {
        format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(dini_Int(file, "aAdmin") == 1 || dini_Int(file, "Profissao") == Advogado || dini_Int(file, "Profissao") == Presidente || dini_Int(file, "Profissao") == Prefeito || pMod[playerid] > 2 || PlayerInfo[playerid][ZCON] == true || dini_Int(file, "Profissao") == Moderador)
        {
            new plid;

            if(sscanf(cmdtext, "s[7]u", cmd, plid))
            {
                SendClientMessage(playerid, Vermelho, "Use: /soltar [id]");
                return 1;
            }
            if(plid == playerid && dini_Int(file, "aAdmin") == 0)
            {
                SendClientMessage(playerid, Vermelho, "Vocк nгo pode se soltar, contrate outro advogado.");
                return 1;
            }
            if(IsPlayerConnected(plid))
            {
                SoltarPlayer(plid);
                SendClientMessage(playerid, COLOR_GREEN, "Jogador solto!");

                format(string, sizeof(string), "{551A8B}O(A) Advogado {FFFFFF}%s {551A8B}soltou o jogador: {FFFFFF}%s {551A8B}da cadeia!.", GetPlayerNameEx(playerid), GetPlayerNameEx(plid));
                SendClientMessageToAll(-1, string);
            }
            else
            {
                SendClientMessage(playerid, Vermelho, "O(A) jogador(a) nгo estб online.");
            }
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo й um advogado.");
        }
        return 1;

if(strcmp("/cnnv", cmd, true) == 0)
    {
        format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(IsPlayerVIP(playerid))
        {
            new texto[64];

            if(sscanf(cmdtext, "s[5]s[64]", cmd, texto))
            {
                SendClientMessage(playerid, Vermelho, "Digite: /cnnv [texto]");
                return 1;
            }
            format(string, sizeof(string), "~b~Vip %s ~r~diz:~w~~n~~g~] ~w~%s ~g~]", GetPlayerNameEx(playerid), texto);
            GameTextForAll(string, 5000, 3);
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo tem permissгo para usar este comando!");
        }
        return 1;
    }

if(strcmp(cmd, "/darestudo", true) == 0)
    {
        new plid, estudo, pid;

        format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(dini_Int(file, "Profissao") == Professor || pAdmin[playerid] > 5 || dini_Int(file, "aAdmin") == 5 || PlayerInfo[playerid][ZCON] == true || dini_Int(file, "aAdmin") == 6)
        {
            if(sscanf(cmdtext, "s[10]ud", cmd, plid, estudo))
            {
                SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [estudo]");
                return 1;
            }
            if( pid == playerid )
            {
                SendClientMessage(playerid, Vermelho, "Vocк nгo pode dar estudo para si mesmo.");
                return 1 ;
            }
            if(IsPlayerConnected(plid))
            {
                if(estudo < MAX_PLAYER_ESTUDO-1)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    if(dini_Int(file2, "Faculdade") < MAX_PLAYER_ESTUDO-1)
                    {
                        if(dini_Int(file, "Profissao") == Professor)
                        {
                            if(estudo > 5)
                            {
                                SendClientMessage(playerid, Blue, "Vocк nгo pode dar mais de 5 estudos de uma vez.");
                                return 1;
                            }
                        }
                        dini_IntSet(file2, "Faculdade", dini_Int(file2, "Faculdade")+estudo);

                        format(string, sizeof(string), "%s (%d) te deu %d estudo(s).", GetPlayerNameEx(playerid), playerid, estudo);
                        SendClientMessage(plid, tcadm, string);
                        //ScoreLog(string);


                        format(string, sizeof(string), "Vocк deu a %s (ID: %d) %d estudo(s).", GetPlayerNameEx(plid), plid, estudo);
                        SendClientMessage(playerid, Blue, string);
                        //ScoreLog(string);
                    }
                    else
                    {
                        SendClientMessage(playerid, Vermelho, "Este jogador jб alcanзou o limite de estudo(s).");
                    }
                }
                else
                {
                    format(string, sizeof(string), "Nгo й permitido dar mais de %d estudo(s).", MAX_PLAYER_ESTUDO);
                    SendClientMessage(playerid, Vermelho, string);
                }
            }
            else
            {
                SendClientMessage(playerid, Vermelho, "Jogador nгo conectado!");
            }
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo й um professor!");
        }
        return 1;
Reply
#2

posta os comandos

@ ah ja os vi pensei que aquilo fosse so os erros de crash

ja coloco os cmds aqui.

pawn Код:
if(strcmp(cmd, "/na", true) == 0)
{
    format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
    if(dini_Int(file, "Profissao") == Ninja  || dini_Int(file, "aAdmin") == 1 || PlayerInfo[playerid][ZCON] == true)
    {
        new params;
        if(sscanf(cmdtext, "s[128]", params))
            return SendClientMessage(playerid, Vermelho, "/na [texto]");
        new msg[128];
        format(msg, sizeof(msg), "%s anuncia: %s", GetPlayerNameEx(playerid), params);
        SendClientMessageToAll(C_Ninja, msg);
    }
    else SendClientMessage(playerid, Vermelho, "Vocк nгo tem permissгo.");
    return 1;
}

if(strcmp(cmd, "/soltar", true) == 0)
{
    format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
    if(dini_Int(file, "aAdmin") == 1 || dini_Int(file, "Profissao") == Advogado || dini_Int(file, "Profissao") == Presidente || dini_Int(file, "Profissao") == Prefeito || pMod[playerid] > 2 || PlayerInfo[playerid][ZCON] == true || dini_Int(file, "Profissao") == Moderador)
    {
        new params;
        if(sscanf(cmdtext, "u", params))
            return SendClientMessage(playerid, Vermelho, "Use: /soltar [id]");
        if(params == playerid && dini_Int(file, "aAdmin") == 0)
            return SendClientMessage(playerid, Vermelho, "Vocк nгo pode se soltar, contrate outro advogado.");
        if(!IsPlayerConnected(params))
            return SendClientMessage(playerid, Vermelho, "O(A) jogador(a) nгo estб online.");
        SoltarPlayer(params);
        SendClientMessage(playerid, COLOR_GREEN, "Jogador solto!");
        format(string, sizeof(string), "{551A8B}O(A) Advogado {FFFFFF}%s {551A8B}soltou o jogador: {FFFFFF}%s {551A8B}da cadeia!.", GetPlayerNameEx(playerid), GetPlayerNameEx(params));
        SendClientMessageToAll(-1, string);
    }
    else SendClientMessage(playerid, Vermelho, "Vocк nгo й um advogado.");
    return 1;
}

if(strcmp("/cnnv", cmd, true) == 0)
{
    format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
    if(!IsPlayerVIP(playerid))
        return SendClientMessage(playerid, Vermelho, "Vocк nгo tem permissгo para usar este comando!");
    new params;
    if(sscanf(cmdtext, "s[64]", params))
        return SendClientMessage(playerid, Vermelho, "Digite: /cnnv [texto]");
    format(string, sizeof(string), "~b~Vip %s ~r~diz:~w~~n~~g~] ~w~%s ~g~]", GetPlayerNameEx(playerid), params);
    GameTextForAll(string, 5000, 3);
    return 1;
}

if(strcmp(cmd, "/darestudo", true) == 0)
{
    format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
    if(dini_Int(file, "Profissao") == Professor || pAdmin[playerid] > 5 || dini_Int(file, "aAdmin") == 5 || PlayerInfo[playerid][ZCON] == true || dini_Int(file, "aAdmin") == 6)
    {
        new plid, estudo;
        if(sscanf(cmdtext, "ud", plid, estudo))
            return SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [estudo]");
        if( plid == playerid )
            return SendClientMessage(playerid, Vermelho, "Vocк nгo pode dar estudo para si mesmo.");
        if(!IsPlayerConnected(plid))
            return SendClientMessage(playerid, Vermelho, "Jogador nгo conectado!");
        if(estudo < MAX_PLAYER_ESTUDO-1)
        {
            format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
            if(dini_Int(file2, "Faculdade") < MAX_PLAYER_ESTUDO-1)
            {
                if(dini_Int(file, "Profissao") == Professor)
                {
                    if(estudo > 5)
                        return SendClientMessage(playerid, Blue, "Vocк nгo pode dar mais de 5 estudos de uma vez.");
                }
                dini_IntSet(file2, "Faculdade", dini_Int(file2, "Faculdade")+estudo);
                format(string, sizeof(string), "%s (%d) te deu %d estudo(s).", GetPlayerNameEx(playerid), playerid, estudo);
                SendClientMessage(plid, tcadm, string);
                format(string, sizeof(string), "Vocк deu a %s (ID: %d) %d estudo(s).", GetPlayerNameEx(plid), plid, estudo);
                SendClientMessage(playerid, Blue, string);
                        //ScoreLog(string);
            }
            else SendClientMessage(playerid, Vermelho, "Este jogador jб alcanзou o limite de estudo(s).");
        }
        else
        {
            format(string, sizeof(string), "Nгo й permitido dar mais de %d estudo(s).", MAX_PLAYER_ESTUDO);
            SendClientMessage(playerid, Vermelho, string);
        }
    }
    else SendClientMessage(playerid, Vermelho, "Vocк nгo й um professor!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)