recieving errors..
#1

Code:
[19:16:50] [debug] Run time error 4: "Array index out of bounds"
[19:16:50] [debug]  Accessing element at index 24 past array upper bound 23
[19:16:50] [debug] AMX backtrace:
[19:16:50] [debug] #0 00013234 in public Wanteds () from CNR.amx
That's what i got from SERVER LOG..


Please help
Reply
#2

Compile with -d3. Here’s how you do it: create a new file named pawn.cfg inside your pawno folder and just put -d3 inside it, save and re-compile then give me the line number. This is called debug level 3.
Reply
#3

Header size: 4456 bytes
Code size: 111612 bytes
Data size: 59916 bytes
Stack/heap size: 16384 bytes; estimated max. usage=497 cells (1988 bytes)
Total requirements: 192368 bytes

1 Warning.


EDIT: the warning isn't related, it's related to not using a function.
Reply
#4

Show us your "Wanteds" function in the script.
Reply
#5

Code:
    if(GetPVarInt(playerid,"Wanted") != pInfo[playerid][pWanted])
{
    new wlvl[9];
    format(wlvl, 9, "%d", pInfo[playerid][pWanted]);
    PlayerTextDrawSetString(playerid, WLvlTD[playerid], wlvl);
    SetPVarInt(playerid,"Wanted", pInfo[playerid][pWanted]);
    new query[128], name[24];
    GetPlayerName(playerid, name, 24);
    format(query, sizeof(query), "UPDATE `playerdata` SET `wanted` = '%d' WHERE `username` = '%s'", pInfo[playerid][pWanted], name);
    mysql_tquery(dbHandle, query);

    new starCount = 0, genTextStr[30];
    if(pInfo[playerid][pWanted] > 0)
	{
        format(genTextStr, sizeof genTextStr, "");
        for(new i = 0; i < pInfo[playerid][pWanted]; i++)
		{
            starCount++;
            if(starCount == 7)
			{
                break;
            }
            else
			{
                strcat(genTextStr, "[]", sizeof genTextStr);
            }
        }
        PlayerTextDrawSetString(playerid, wLvlStars[playerid], genTextStr);
    }

    if(pInfo[playerid][pWanted] == 0) {
        PlayerTextDrawSetString(playerid, wLvlStars[playerid], "");
    }
PRIVATE200 :@ XD
Reply
#6

fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)