• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Error 4: Index Out Of Bound
#2
Code:
#define MAX_GIFT 100



LoadGiftEvent()

{

    new rows;

    cache_get_row_count(rows);  

    if(!rows) return 0;



    for(new i = 0; i < rows; i)

    {

        cache_get_value_name_int(i, "id", g_gift[i][G_SQL_ID]);

        cache_get_value_name_float(i, "x", g_gift[i][G_POS_X]);

        cache_get_value_name_float(i, "y", g_gift[i][G_POS_Y]);

        cache_get_value_name_float(i, "z", g_gift[i][G_POS_Z]);

        TotalGift;

    }

    RandomizeGift();

    printf("[MySQL R41-3]: Gift diunggah: %i pcs.", TotalGift);

    return 1;

}



Randomize()

{

    //No Error There

}

This shouldn't fix it, however I "fixed" the loop



Give us the structure of g_gift (enum declaration)
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply


Messages In This Thread
Error 4: Index Out Of Bound - by Jonies - 2020-10-25, 12:56 PM
RE: Error 4: Index Out Of Bound - by Pinch - 2020-10-25, 02:16 PM
RE: Error 4: Index Out Of Bound - by Expert* - 2020-10-26, 10:06 AM
RE: Error 4: Index Out Of Bound - by Pinch - 2020-10-26, 10:30 AM
RE: Error 4: Index Out Of Bound - by Expert* - 2020-10-26, 10:47 AM
RE: Error 4: Index Out Of Bound - by Pinch - 2020-10-26, 11:02 AM
RE: Error 4: Index Out Of Bound - by Expert* - 2020-10-30, 07:49 PM
RE: Error 4: Index Out Of Bound - by Jonies - 2020-10-27, 06:42 AM
RE: Error 4: Index Out Of Bound - by Expert* - 2020-10-30, 07:53 PM
RE: Error 4: Index Out Of Bound - by Pinch - 2020-10-30, 08:34 PM

Forum Jump: