SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/05/2014, 06:42 PM   #1
Slicebook
Big Clucker
 
Join Date: Jan 2014
Posts: 182
Reputation: 1
Default error 028: invalid subscript (not an array or too many subscripts): "pInfo"

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 ,
Slicebook is offline   Reply With Quote
Old 26/05/2014, 06:43 PM   #2
sl!x
Big Clucker
 
sl!x's Avatar
 
Join Date: Jul 2012
Posts: 67
Reputation: 5
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

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]; 
__________________
sl!x is offline   Reply With Quote
Old 26/05/2014, 06:58 PM   #3
Slicebook
Big Clucker
 
Join Date: Jan 2014
Posts: 182
Reputation: 1
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

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!
Slicebook is offline   Reply With Quote
Old 26/05/2014, 06:59 PM   #4
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,827
Reputation: 1401
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

It should be:
pawn Code:
PlayerInfo[playerid][Penz]
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 26/05/2014, 07:02 PM   #5
Slicebook
Big Clucker
 
Join Date: Jan 2014
Posts: 182
Reputation: 1
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

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
Slicebook is offline   Reply With Quote
Old 26/05/2014, 07:14 PM   #6
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,827
Reputation: 1401
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

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.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 26/05/2014, 07:29 PM   #7
Slicebook
Big Clucker
 
Join Date: Jan 2014
Posts: 182
Reputation: 1
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

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?
Slicebook is offline   Reply With Quote
Old 26/05/2014, 07:35 PM   #8
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,827
Reputation: 1401
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

Quote:
Originally Posted by Slicebook View Post
Can you give an example please?
Of what?
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 26/05/2014, 07:53 PM   #9
XK
Huge Clucker
 
XK's Avatar
 
Join Date: Mar 2014
Location: A Rare Place
Posts: 242
Reputation: 30
Default Re: error 028: invalid subscript (not an array or too many subscripts): "pInfo"

Replace pInfo in that error line with PlayerInfo
__________________
By XK:
And are we meant to guess your Request?

XK is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LGW.pwn(443) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" Grooty Scripting Help 3 26/07/2013 03:06 PM
Help: error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" gnoomen2 Scripting Help 2 20/07/2013 02:40 AM
(225) : error 028: invalid subscript (not an array or too many subscripts): "pInfo" jeffery30162 Scripting Help 11 24/06/2013 09:41 PM
error 028: invalid subscript (not an array or too many subscripts): "SpawnPos" newbienoob Scripting Help 0 17/02/2013 02:27 PM
[Ajuda] error 028: invalid subscript (not an array or too many subscripts): "VCVGang" duuuwh Portuguęs/Portuguese 10 20/11/2012 08:01 PM


All times are GMT. The time now is 03:53 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.