18.03.2017, 20:36
PHP код:
[14:27:04] [debug] Run time error 4: "Array index out of bounds"
[14:27:04] [debug] Attempted to read/write array element at index 91 in array of size 91
[14:27:04] [debug] AMX backtrace:
[14:27:04] [debug] #0 001694e4 in public dmgTdUpdate () from Mundito.amx
PHP код:
public dmgTdUpdate()
{
for(new playerid = 0; playerid < MAX_SERVER_PLAYERS; playerid++)
{
if(!IsPlayerConnected(playerid)) continue;
if(txdAlpha[0][playerid] > 0)
{
TextDrawColor(txd[0][playerid], setAlpha(COLOR_LEFT, txdAlpha[0][playerid]));
TextDrawBackgroundColor(txd[0][playerid], setAlpha(0x000000FF, txdAlpha[0][playerid] / 0x6));
TextDrawShowForPlayer(playerid, txd[0][playerid]);
txdAlpha[0][playerid] -= 0x6;
}
else if(txdAlpha[0][playerid] < 0)
{
TextDrawHideForPlayer(playerid, txd[0][playerid]);
txdAlpha[0][playerid] = 0;
for(new a = 0; a < MAX_SERVER_PLAYERS; a++)
currentHpLoss[0][playerid][a] = 0.0;
}
if(txdAlpha[1][playerid] > 0)
{
TextDrawColor(txd[1][playerid], setAlpha(COLOR_RIGHT, txdAlpha[1][playerid]));
TextDrawBackgroundColor(txd[1][playerid], setAlpha(0x000000FF, txdAlpha[1][playerid] / 0x6));
TextDrawShowForPlayer(playerid, txd[1][playerid]);
txdAlpha[1][playerid] -= 0x6;
}
else if(txdAlpha[1][playerid] < 0)
{
TextDrawHideForPlayer(playerid, txd[1][playerid]);
txdAlpha[1][playerid] = 0;
for(new a = 0; playerid < MAX_SERVER_PLAYERS; a++)
currentHpLoss[1][playerid][a] = 0.0;
}
}
}
setAlpha(color, a)
{
return (((color >> 24) & 0xFF) << 24 | ((color >> 16) & 0xFF) << 16 | ((color >> 8) & 0xFF) << 8 | floatround((float(color & 0xFF) / 255) * a));
}
createTextDraws()
{
for(new playerid = 0; playerid < MAX_SERVER_PLAYERS; playerid++)
{
txd[0][playerid] = TextDrawCreate(200.0, 370.0, " ");
TextDrawLetterSize(txd[0][playerid], 0.24, 1.1);
TextDrawColor(txd[0][playerid], COLOR_LEFT);
TextDrawFont(txd[0][playerid], 1);
TextDrawSetShadow(txd[0][playerid], 0);
TextDrawAlignment(txd[0][playerid], 2);
TextDrawSetOutline(txd[0][playerid], 1);
TextDrawBackgroundColor(txd[0][playerid], 0x0000000F);
txd[1][playerid] = TextDrawCreate(440.0, 370.0, " ");
TextDrawLetterSize(txd[1][playerid], 0.24, 1.1);
TextDrawColor(txd[1][playerid], COLOR_RIGHT);
TextDrawFont(txd[1][playerid], 1);
TextDrawSetShadow(txd[1][playerid], 0);
TextDrawAlignment(txd[1][playerid], 2);
TextDrawSetOutline(txd[1][playerid], 1);
TextDrawBackgroundColor(txd[1][playerid], 0x0000000F);
}
}