Array index out of bounds
#1

Hello, this is my code:
pawn Код:
public OnFilterScriptInit ()
{
    printf (" \nSchool Project Loaded.\n");

    SetTimer ("CheckValidTextDraws", 1000, 1);

    RadarHud = TextDrawCreate (495.0, 200.0, "~b~Model: ~n~~r~Speed:         kmph");
    TextDrawFont (RadarHud, 2);
    TextDrawLetterSize (RadarHud, 0.3, 1.0);

    for (new i = 1; i <= MAX_VEHICLES; i++)
    {
        VehRadarID [i] = -1;
        SpeedAndModel [i] = TextDrawCreate (545.0, 200.0, "~b~ ~n~~r~");
        TextDrawFont (SpeedAndModel [i], 2);
        TextDrawLetterSize (SpeedAndModel [i], 0.3, 1.0);
        CheckingSpeed [i] = 0;
    }

    return 1;
}
And that gives me something back from crashdetect:
Код:
[13:45:15] [debug] Run time error 4: "Array index out of bounds"
[13:45:15] [debug]  Accessing element at index 2000 past array upper bound 1999
[13:45:15] [debug] AMX backtrace:
[13:45:15] [debug] #0 000001f0 in public OnFilterScriptInit () from SchoolProject.amx
Why does it do that?
Reply


Messages In This Thread
Array index out of bounds - by thimo - 11.08.2013, 11:23
Re: Array index out of bounds - by Misiur - 11.08.2013, 11:29

Forum Jump:


Users browsing this thread: 1 Guest(s)