04.08.2018, 16:05
Hi, i want to test a gamemode that i found and i get a problem that i get in mine but i fixed it easy, this is more difficult, i dont find the error
Si its say the error is in progress.inc include and gamemode line 8722..
Gamemode line 8722:
progress.inc line 71:
Bars[barid][pb_x] = x;
Bars[barid][pb_y] = y;
Bars[barid][pb_w] = width;
Bars[barid][pb_h] = height;
Bars[barid][pb_m] = max;
Bars[barid][pb_color] = color;
Bars[barid][pb_created] = true;
return Bar:barid;
}
thank you again..
Quote:
[debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 682 past array upper bound 681 [debug] AMX backtrace: [debug] #0 0000352c in Bar:CreateProgressBar (Float=1.00000, Float:y=444.00000, Float:width=638.50000, Float:height=2.50000, color=-1802267649, Float:max=100.00000) at C:\Reality Roleplay\gm\asdasd\GameMode\pawno\include\progress .inc:71 [debug] #1 000aa490 in public cargartodo () at C:\Reality Roleplay\gm\gmniceca\GameMode\gamemodes\OC.pwn:872 2 |
Si its say the error is in progress.inc include and gamemode line 8722..
Gamemode line 8722:
PHP код:
XP[i] = CreateProgressBar(1.00, 444.00, 638.50, 2.50, -1802267649, 100.0);
PHP код:
stock Bar:CreateProgressBar(Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0)
{
new
barid;
for(barid = 0; barid < sizeof Bars; ++barid)
if(!Bars[barid][pb_created]) break;
if(Bars[barid][pb_created] || barid == sizeof Bars) // HERE, maybe i have to update progress inc?
return INVALID_BAR_ID;
new Text:in_t = Bars[barid][pb_t1] = TextDrawCreate(x, y, "_");
TextDrawUseBox (in_t, 1);
TextDrawTextSize (in_t, x + width, 0.0);
TextDrawLetterSize (in_t, 1.0, height / 10);
TextDrawBoxColor (in_t, 0x00000000 | (color & 0x000000FF));
in_t = Bars[barid][pb_t2] = TextDrawCreate(x + 1.2, y + 2.15, "_");
TextDrawUseBox (in_t, 1);
TextDrawTextSize (in_t, x + width - 2.0, 0.0);
TextDrawLetterSize (in_t, 1.0, height / 10 - 0.35);
TextDrawBoxColor (in_t, (color & 0xFFFFFF00) | (0x66 & ((color & 0x000000FF) / 2)));
in_t = Bars[barid][pb_t3] = TextDrawCreate(x + 1.2, y + 2.15, "_");
TextDrawTextSize (in_t, pb_percent(x, width, max, 1.0), 0.0);
TextDrawLetterSize (in_t, 1.0, height / 10 - 0.35);
TextDrawBoxColor (in_t, color);
Bars[barid][pb_y] = y;
Bars[barid][pb_w] = width;
Bars[barid][pb_h] = height;
Bars[barid][pb_m] = max;
Bars[barid][pb_color] = color;
Bars[barid][pb_created] = true;
return Bar:barid;
}
thank you again..