debug problem
#5

pawn Код:
[10:26:03] [debug] Run time error 4: "Array index out of bounds"
[10:26:03] [debug]  Accessing element at negative index -1
[10:26:03] [debug] AMX backtrace:
[10:26:03] [debug] #0 0015d2b8 in public cmd_stats (playerid=10, params[]=@0x00d98578 "") at C:\AMD\GMBUN\rp.pwn:36169
[10:26:03] [debug] #1 00007f18 in public OnPlayerCommandText (playerid=10, cmdtext[]=@0x00d9855c "/stats") at C:\Users\Filip\Desktop\SERVER\pawno\include\zcmd.inc:104
Command resolved
pawn Код:
COMMAND:stats(playerid,params[])
{

    if(character_chosen[playerid])
    {

        if(active_character[playerid] != -1)
        {
            new str[256];
            new tmp[32];
            new tmp2[32];
            new tmp3[32];
            new name[MAX_PLAYER_NAME];
            new facslot = GetFactionSlot(CharacterInfo[playerid][active_character[playerid]][cFaction]);
            GetCharacterName(playerid,name);
            format(str,sizeof(str),"*%s*",name);
            SendClientMessage(playerid,COLOR_GREEN,str);
            if(CharacterInfo[playerid][active_character[playerid]][cCarLic]) { format(tmp,sizeof(tmp),"Da"); } else { format(tmp,sizeof(tmp),"Nu"); }
            if(CharacterInfo[playerid][active_character[playerid]][cWepLic]) { format(tmp2,sizeof(tmp2),"Da"); } else { format(tmp2,sizeof(tmp2),"Nu"); }
            format(str,sizeof(str),"Bani:[$%d] Banca:[$%d] Permis:[%s] Permis Port-Arma:[%s]",CharacterInfo[playerid][active_character[playerid]][cMoney],CharacterInfo[playerid][active_character[playerid]][cBank],tmp,tmp2);
            SendClientMessage(playerid,COLOR_WHITE,str);
            if(!CharacterInfo[playerid][active_character[playerid]][cFaction]) { format(tmp,sizeof(tmp),"Fara"); } else { new slot = GetFactionSlot(CharacterInfo[playerid][active_character[playerid]][cFaction]); format(tmp,sizeof(tmp),"%s",FactionInfo[slot][fName]); }
            if(!CharacterInfo[playerid][active_character[playerid]][cFaction]) { format(tmp,sizeof(tmp),"Fara"); } else { format(tmp,sizeof(tmp),"%s",FactionInfo[facslot][fName]); }
            if(!mask[playerid]) { format(tmp3,sizeof(tmp3),"Nu"); } else { format(tmp3,sizeof(tmp3),"Da"); }
            format(str,sizeof(str),"Factiune:[%s] Rank:[%s] Numar Telefon:[%d] Masca:[%s]",tmp,tmp2,CharacterInfo[playerid][active_character[playerid]][cPhone],tmp3);
            SendClientMessage(playerid,COLOR_WHITE,str);
            if(!HasItem(INVENTORY_TYPE_PLAYER,playerid,INVENTORY_RADIO,1)) { format(tmp,sizeof(tmp),"Nu"); } else { format(tmp,sizeof(tmp),"Da"); }
            new jname[256];
            GetJobName(CharacterInfo[playerid][active_character[playerid]][cJob],jname);
            new jcooldown = (CharacterInfo[playerid][active_character[playerid]][cJobCooldown] / 60);
            format(str,sizeof(str),"Radio:[%s] Frecventa:[%d] Economii:[$%d] Job:[%s] Noul Job:[%d mins]",tmp,CharacterInfo[playerid][active_character[playerid]][cRadioChannel],CharacterInfo[playerid][active_character[playerid]][cSavings],jname,jcooldown);
            SendClientMessage(playerid,COLOR_WHITE,str);
            if(CharacterInfo[playerid][active_character[playerid]][cPayTime] > 60)
            {
                format(tmp,sizeof(tmp),"%d minute",(CharacterInfo[playerid][active_character[playerid]][cPayTime] / 60));
            }
            else
            {
                format(tmp,sizeof(tmp),"Imediat...");
            }
            if(CharacterInfo[playerid][active_character[playerid]][cHealthInsurance]) { format(tmp3,sizeof(tmp3),"Da"); } else { format(tmp3,sizeof(tmp3),"Nu"); }
            format(str,sizeof(str),"Nivel:[%d] Exp:[%d/%d] Payday:[%s] Salariu:[$%d] Decese:[%d]  Asigurari:[%s]",CharacterInfo[playerid][active_character[playerid]][cLevel],CharacterInfo[playerid][active_character[playerid]][cExp],(8 * CharacterInfo[playerid][active_character[playerid]][cLevel]),tmp,(CharacterInfo[playerid][active_character[playerid]][cPayday] + 1000),CharacterInfo[playerid][active_character[playerid]][cDeaths],tmp3);
            SendClientMessage(playerid,COLOR_WHITE,str);
            if(dice[playerid]) { format(tmp,sizeof(tmp),"Da"); } else { format(tmp,sizeof(tmp),"Nu"); }
            if(gps[playerid]) { format(tmp2,sizeof(tmp2),"Da"); } else { format(tmp2,sizeof(tmp2),"Nu"); }
            if(rope[playerid]) { format(tmp3,sizeof(tmp3),"Da"); } else { format(tmp3,sizeof(tmp3),"Nu"); }
            new cname[64];
            if(CharacterInfo[playerid][active_character[playerid]][cCompany] > 0)
            {

                new cslot = FetchCompanySlot(CharacterInfo[playerid][active_character[playerid]][cCompany]);
                format(cname,sizeof(cname),"%s",CompanyInfo[cslot][ciName]);

            }
            else { format(cname,sizeof(cname),"Fara"); }
            new lang[64];
            FetchLanguageName(CharacterInfo[playerid][active_character[playerid]][cLanguage],lang);
            format(str,sizeof(str),"Zar:[%s] GPS:[%s] Franghie:[%s] Companie:[%s] Limba:[%s]",tmp,tmp2,tmp3,cname,lang);
            SendClientMessage(playerid,COLOR_WHITE,str);
            new skill_name[128];
            GetSkillName(skill_name,CharacterInfo[playerid][active_character[playerid]][cSkill]);
            format(str,sizeof(str),"Skill:[%s] Nivel skill:[%d]",skill_name,CharacterInfo[playerid][active_character[playerid]][cSkillLevel]);
            SendClientMessage(playerid,COLOR_WHITE,str);
            return 1;
        }
    }
    else
    {

        SendClientMessage(playerid,COLOR_GREY,"Te rog alege caracterul intai.");
        return 1;

    }

}

------------------------------------------------
pawn Код:
[18:30:47] [debug] Run time error 4: "Array index out of bounds"
[18:30:47] [debug]  Accessing element at index 111 past array upper bound 59
[18:30:47] [debug] AMX backtrace:
[18:30:47] [debug] #0 000597b0 in public OnPlayerText (playerid=48, text[]=@0x00d9855c "500") at C:\AMD\GMBUN\rp.pwn:7386

[18:31:01] [debug] Run time error 4: "Array index out of bounds"
[18:31:01] [debug]  Accessing element at index 70 past array upper bound 59
[18:31:01] [debug] AMX backtrace:
[18:31:01] [debug] #0 000597b0 in public OnPlayerText (playerid=48, text[]=@0x00d9855c "4000") at C:\AMD\GMBUN\rp.pwn:7386

[18:31:13] [debug] Run time error 4: "Array index out of bounds"
[18:31:13] [debug]  Accessing element at index 111 past array upper bound 59
[18:31:13] [debug] AMX backtrace:
[18:31:13] [debug] #0 000597b0 in public OnPlayerText (playerid=48, text[]=@0x00d9855c "iar e bug") at C:\AMD\GMBUN\rp.pwn:7386


[18:31:23] [debug] Run time error 4: "Array index out of bounds"
[18:31:23] [debug]  Accessing element at index 111 past array upper bound 59
[18:31:23] [debug] AMX backtrace:
[18:31:23] [debug] #0 000597b0 in public OnPlayerText (playerid=48, text[]=@0x00d9855c "500") at C:\AMD\GMBUN\rp.pwn:7386
resolved

pawn Код:
if(-1 < biz_editingentrance[playerid] < MAX_BIZES )
        {

            new amount = strval(text);
            if(amount < 0 || amount > 100000) { SendClientMessage(playerid,COLOR_LIGHTRED,"Pretul intrari nu poate fi mai mic de $0 si mai mare de $100000"); return 0; }
            BizInfo[biz_editingentrance[playerid]][bEntranceFee] = amount;
            new str[128];
            format(str,sizeof(str),"Ai setat pretul de intrare la $%d",amount);
            SendClientMessage(playerid,COLOR_GREEN,str);
            TogglePlayerControllable(playerid,1);
            new biz = biz_editingentrance[playerid];
            new str2[128];
            format(str2,sizeof(str),"Informatii Afacere\n%s\n\nPret Intrare: $%d\nFoloseste /enter pentru a intra",BizInfo[biz][bName],BizInfo[biz][bEntranceFee]);
//string set from 64 to 128         Update3DTextLabelText(BizInfo[biz][bPickup],COLOR_LIGHTBLUE,str2);
            biz_editingentrance[playerid] = -1;
            return 0;

        }
--------------------------------------------
pawn Код:
[02:51:06] [debug] Run time error 4: "Array index out of bounds"
[02:51:06] [debug]  Accessing element at negative index -1
[02:51:06] [debug] AMX backtrace:
[02:51:06] [debug] #0 001d6888 in cl_RemovePlayerFromDressingRoom (playerid=1) at C:\AMD\GMBUN\rp.pwn:51572
[02:51:06] [debug] #1 0006b244 in public OnDialogResponse (playerid=1, dialogid=44, response=0, listitem=0, inputtext[]=@0x00d9855c "Masti") at C:\AMD\GMBUN\rp.pwn:9895
stock resolved

pawn Код:
stock cl_RemovePlayerFromDressingRoom(playerid)
{
     if(active_character[playerid] != -1)
    {
        new biz = in_biz[playerid];
        SetPlayerPos(playerid,BizInfo[biz][bInteriorX],BizInfo[biz][bInteriorY],BizInfo[biz][bInteriorZ]);
        SetPlayerInterior(playerid,BizInfo[biz][bInterior]);
        SetPlayerVirtualWorld(playerid,(biz + 2000));
        SetCameraBehindPlayer(playerid);
        TogglePlayerControllable(playerid,1);
    }
}

It's ok ?
Reply


Messages In This Thread
debug problem - by Jony_Cruze - 09.11.2013, 20:18
Re: debug problem - by Konstantinos - 09.11.2013, 20:23
Re: debug problem - by Jony_Cruze - 10.11.2013, 06:18
Re: debug problem - by Konstantinos - 10.11.2013, 09:59
Re: debug problem - by Jony_Cruze - 10.11.2013, 10:51
Re: debug problem - by Konstantinos - 10.11.2013, 13:12
Re: debug problem - by Jony_Cruze - 10.11.2013, 13:19
Re: debug problem - by Jony_Cruze - 10.11.2013, 14:30
Re: debug problem - by Konstantinos - 10.11.2013, 14:42
Re: debug problem - by Jony_Cruze - 10.11.2013, 15:04

Forum Jump:


Users browsing this thread: 1 Guest(s)