SA-MP Forums Archive
Error 028: invalid subscript (not an array or too many subscripts): - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error 028: invalid subscript (not an array or too many subscripts): (/showthread.php?tid=601195)



Error 028: invalid subscript (not an array or too many subscripts): - Black Axe - 18.02.2016

Problem fixed, thanks.


Re: Error 028: invalid subscript (not an array or too many subscripts): - illuminati2 - 18.02.2016

try replacing

1.
PHP код:
enum FacInfo 
2.
PHP код:
new FactionInfo[MAX_FACTIONS][FacInfo]; 
3.
PHP код:
                if (8)
                {
                    else if(
strcmp(key"FactionSkins") == 0FacInfo[i][FactionSkins][j] = strval(line[s]);
                }
                else
                {
                    else if(
strcmp(key"FactionWeapons") == 0FacInfo[i][FactionWeapons][j] = strval(line[s]);
                    else if(
strcmp(key"FactionAmmo") == 0FacInfo[i][FactionAmmo][j] = strval(line[s]);
                } 
With

1.
PHP код:
enum FacInfo_ENUM 
2.
PHP код:
new FacInfo[MAX_FACTIONS][FacInfo_ENUM]; 
3.
PHP код:
                if (8)
                {
                    if(
strcmp(key"FactionSkins") == 0FacInfo[i][FactionSkins][j] = strval(line[s]);
                }
                else
                {
                    if(
strcmp(key"FactionWeapons") == 0FacInfo[i][FactionWeapons][j] = strval(line[s]);
                    else if(
strcmp(key"FactionAmmo") == 0FacInfo[i][FactionAmmo][j] = strval(line[s]);
                } 
Now it's compiling fine for me.

Edit:- You're welcome


Re: Error 028: invalid subscript (not an array or too many subscripts): - Black Axe - 18.02.2016

Quote:
Originally Posted by illuminati2
Посмотреть сообщение
try replacing

1.
PHP код:
enum FacInfo 
2.
PHP код:
new FactionInfo[MAX_FACTIONS][FacInfo]; 
3.
PHP код:
                if (8)
                {
                    else if(
strcmp(key"FactionSkins") == 0FacInfo[i][FactionSkins][j] = strval(line[s]);
                }
                else
                {
                    else if(
strcmp(key"FactionWeapons") == 0FacInfo[i][FactionWeapons][j] = strval(line[s]);
                    else if(
strcmp(key"FactionAmmo") == 0FacInfo[i][FactionAmmo][j] = strval(line[s]);
                } 
With

1.
PHP код:
enum FacInfo_ENUM 
2.
PHP код:
new FacInfo[MAX_FACTIONS][FacInfo_ENUM]; 
3.
PHP код:
                if (8)
                {
                    if(
strcmp(key"FactionSkins") == 0FacInfo[i][FactionSkins][j] = strval(line[s]);
                }
                else
                {
                    if(
strcmp(key"FactionWeapons") == 0FacInfo[i][FactionWeapons][j] = strval(line[s]);
                    else if(
strcmp(key"FactionAmmo") == 0FacInfo[i][FactionAmmo][j] = strval(line[s]);
                } 
Now it's compiling fine for me.
Wow that actually did work, I understand replacing the else if with if as that was a mistake by me, but got any explanation for renaming the enum? Thanks!