SA-MP Forums Archive
error 028: invalid subscript (not an array or too many subscripts): "pInfo" - 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): "pInfo" (/showthread.php?tid=515564)



error 028: invalid subscript (not an array or too many subscripts): "pInfo" - Slicebook - 26.05.2014

Code:
C:\Users\Lalika\Downloads\Szero\Szerу\gamemodes\Matyi.pwn(3499) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
C:\Users\Lalika\Downloads\Szero\Szerу\gamemodes\Matyi.pwn(3499) : warning 215: expression has no effect
C:\Users\Lalika\Downloads\Szero\Szerу\gamemodes\Matyi.pwn(3499) : error 001: expected token: ";", but found "]"
C:\Users\Lalika\Downloads\Szero\Szerу\gamemodes\Matyi.pwn(3499) : error 029: invalid expression, assumed zero
C:\Users\Lalika\Downloads\Szero\Szerу\gamemodes\Matyi.pwn(3499) : fatal error 107: too many error messages on one line
help please!

Code:
pInfo[playerid][Penz]
<<ERROR

Code:
enum pInfo
{
	Admin,
	Munka,
	pSkin,
	Float:pX,
	Float:pY,
	Float:pZ,
	Float:pA,
	admin2,
	askin,
	Penz, <<<money
	Ehseg,
	Frakcio,
	Jogsi,
	Kaja,
	Fegyver,
	Leader
	
}
new PlayerInfo[MAX_PLAYERS][pInfo];
bank system,not good for the money script ,


Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - sl!x - 26.05.2014

try this
PHP Code:
enum pInfo
{
    
Admin,
    
Munka,
    
pSkin,
    
Float:pX,
    
Float:pY,
    
Float:pZ,
    
Float:pA,
    
admin2,
    
askin,
    
Penz, <<<money
    Ehseg,
    Frakcio,
    Jogsi,
    Kaja,
    Fegyver,
    Leader
    
};
new PlayerInfo[MAX_PLAYERS][pInfo]; 



Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - Slicebook - 26.05.2014

Quote:
Originally Posted by sl!x
View Post
try this
PHP Code:
enum pInfo
{
    
Admin,
    
Munka,
    
pSkin,
    
Float:pX,
    
Float:pY,
    
Float:pZ,
    
Float:pA,
    
admin2,
    
askin,
    
Penz, <<<money
    Ehseg,
    Frakcio,
    Jogsi,
    Kaja,
    Fegyver,
    Leader
    
};
new PlayerInfo[MAX_PLAYERS][pInfo]; 
don't work!


Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - Konstantinos - 26.05.2014

It should be:
pawn Code:
PlayerInfo[playerid][Penz]



Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - Slicebook - 26.05.2014

One code:
Code:
	new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),PlayerFile,Name);
	if(!dini_Exists(file)) {
		dini_Create(file);
		dini_IntSet(file,"Penz",pInfo[playerid][Penz]);
	}
 	else if(dini_Exists(file))
	{
	pInfo[playerid][Penz] = dini_Int(file,"Penz");
	}
    return 1;
}
there is even more than that is the same error


Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - Konstantinos - 26.05.2014

If the whole script uses pInfo as the name of the array, then swap them.
pawn Code:
enum PlayerInfo
{
    ...
};
new pInfo[MAX_PLAYERS][pInfo];
else.. you have to change them all.


Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - Slicebook - 26.05.2014

Quote:
Originally Posted by Konstantinos
View Post
If the whole script uses pInfo as the name of the array, then swap them.
pawn Code:
enum PlayerInfo
{
    ...
};
new pInfo[MAX_PLAYERS][pInfo];
else.. you have to change them all.
Can you give an example please?


Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - Konstantinos - 26.05.2014

Quote:
Originally Posted by Slicebook
View Post
Can you give an example please?
Of what?


Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo" - XK - 26.05.2014

Replace pInfo in that error line with PlayerInfo