Textdraw: Array index out of bounds
#1

Simple global textdraw declaration and initialization and checking for clicks on it.

pawn Код:
static Text:AmmunationGlobal[17];

hook OnGameModeInit() {
    // A bunch of textdraws...

    AmmunationGlobal[16] = TextDrawCreate(431.699951, 164.310958, "X");
    TextDrawLetterSize(AmmunationGlobal[16], 0.318331, 1.122961);
    TextDrawTextSize(AmmunationGlobal[16], 9.000000, 9.000000);
    TextDrawAlignment(AmmunationGlobal[16], 2);
    TextDrawColor(AmmunationGlobal[16], -1);
    TextDrawUseBox(AmmunationGlobal[16], 1);
    TextDrawBoxColor(AmmunationGlobal[16], -16776961);
    TextDrawSetShadow(AmmunationGlobal[16], 0);
    TextDrawSetOutline(AmmunationGlobal[16], 0);
    TextDrawBackgroundColor(AmmunationGlobal[16], 255);
    TextDrawFont(AmmunationGlobal[16], 1);
    TextDrawSetProportional(AmmunationGlobal[16], 1);
    TextDrawSetSelectable(AmmunationGlobal[16], true);
}

hook OnPlayerClickTextDraw(playerid, Text:clickedid) {
    if(clickedid == AmmunationGlobal[16]) {
        CancelSelectTextDraw(playerid);
        CloseAmmunationStore(playerid);
    }
    return 0;
}
In fact, everything works fine. I'm getting this from crashdetect, though.
Код:
[00:59:42] [debug] Run time error 4: "Array index out of bounds"
[debug] AMX backtrace:
[debug] #0 00066b14 in ?? (0) from main.amx
[debug] #1 0005f88c in ?? (0) from main.amx
[debug] #2 0006a310 in ?? (0, 22, 0, 0, 8, 0, 22, 0, 0, 0, ... <1073741813 arguments>) from main.amx
[debug] #3 0001a7a4 in public OnPlayerClickTextDraw (0, 22) from main.amx
Why am I getting these?
Reply


Messages In This Thread
Textdraw: Array index out of bounds - by Manyula - 12.01.2018, 23:20
Re: Textdraw: Array index out of bounds - by denNorske - 12.01.2018, 23:38
Re: Textdraw: Array index out of bounds - by Manyula - 13.01.2018, 10:38
Re: Textdraw: Array index out of bounds - by denNorske - 14.01.2018, 08:06

Forum Jump:


Users browsing this thread: 1 Guest(s)