[debug] Attempted to read/write array element at index 90 in array of size 90 HELP ME D:
#1

[16:34:21] [debug] Run time error 4: "Array index out of bounds"
[16:34:21] [debug] Attempted to read/write array element at index 90 in array of size 90
[16:34:21] [debug] AMX backtrace:
[16:34:21] [debug] #0 00169514 in public dmgTdUpdate () from Mundito.amx

CODE:
PHP код:
public dmgTdUpdate()
{
        for(new 
playerid 0playerid MAX_SERVER_PLAYERSplayerid++)
        {
                if(!
IsPlayerConnected(playerid)) continue;
                if(
txdAlpha[0][playerid] > 0)
                {
                        
TextDrawColor(txd[0][playerid], setAlpha(COLOR_LEFTtxdAlpha[0][playerid]));
                        
TextDrawBackgroundColor(txd[0][playerid], setAlpha(0x000000FFtxdAlpha[0][playerid] / 0x6));
                        
TextDrawShowForPlayer(playeridtxd[0][playerid]);
                        
txdAlpha[0][playerid] -= 0x6;
                }
                else if(
txdAlpha[0][playerid] < 0)
                {
                        
TextDrawHideForPlayer(playeridtxd[0][playerid]);
                        
txdAlpha[0][playerid] = 0;
                        for(new 
0MAX_SERVER_PLAYERSa++)
                                
currentHpLoss[0][playerid][a] = 0.0;
                }
                if(
txdAlpha[1][playerid] > 0)
                {
                        
TextDrawColor(txd[1][playerid], setAlpha(COLOR_RIGHTtxdAlpha[1][playerid]));
                        
TextDrawBackgroundColor(txd[1][playerid], setAlpha(0x000000FFtxdAlpha[1][playerid] / 0x6));
                        
TextDrawShowForPlayer(playeridtxd[1][playerid]);
                        
txdAlpha[1][playerid] -= 0x6;
                }
                else if(
txdAlpha[1][playerid] < 0)
                {
                        
TextDrawHideForPlayer(playeridtxd[1][playerid]);
                        
txdAlpha[1][playerid] = 0;
                        for(new 
0playerid MAX_SERVER_PLAYERSa++)
                                
currentHpLoss[1][playerid][a] = 0.0;
                }
        }
}
setAlpha(colora)
{
        return (((
color >> 24) & 0xFF) << 24 | ((color >> 16) & 0xFF) << 16 | ((color >> 8) & 0xFF) << floatround((float(color 0xFF) / 255) * a));
}
createTextDraws()
{
        for(new 
playerid 0playerid MAX_SERVER_PLAYERSplayerid++)
        {
                
txd[0][playerid] = TextDrawCreate(200.0370.0" ");
                
TextDrawLetterSize(txd[0][playerid], 0.241.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.0370.0" ");
                
TextDrawLetterSize(txd[1][playerid], 0.241.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);
        }

help me, u_u
Reply
#2

show the creation of txdAlpha & currentHpLoss arrays
Reply
#3

PHP код:
new
 
Text:txd[2][MAX_SERVER_PLAYERS],
 
txdAlpha[2][MAX_SERVER_PLAYERS],
 
Float:currentHpLoss[2][MAX_SERVER_PLAYERS][MAX_SERVER_PLAYERS]; 
Reply
#4

PHP код:
new Text:txd[2][MAX_SERVER_PLAYERS], txdAlpha[2][MAX_SERVER_PLAYERS], Float:currentHpLoss[2][MAX_SERVER_PLAYERS][MAX_SERVER_PLAYERS+1]; 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)