invalid subscript
#1

This my first time seeing this error so I don't know how to fix it. If anyone knows how to fix it would please post so I can get past this error and continue scripting?

Код:
error 028: invalid subscript (not an array or too many subscripts): "Pet"
Reply
#2

Im not really sure, but you maybe did some thing like

pawn Код:
PlayerInfo[playerid][Pet]] = 1; // an extra ]
if so change it to
pawn Код:
PlayerInfo[playerid][Pet] = 1;
Reply
#3

This is what I have:
pawn Код:
dini_IntSet(File,"Weight",Pet[playerid][Weight]);
Reply
#4

Look in your enum and look for an extra ] or [
If that is not the problem then idk, sry
Reply
#5

Do you have:
pawn Код:
Pet[MAX_PLAYERS] ["Your enum name"]
Reply
#6

Yes i do.
pawn Код:
enum PlayerPets
{
    Pet[24],
    Name[24],
    Level,
    Size[24],
    Weight,
    HasPet
};
new Pets[MAX_PLAYERS][PlayerPets];
Thats what i have
Reply
#7

Fixed it. I feel dumb now.
Reply
#8

try
Код:
dini_IntSet(File,"Weight",Pets[playerid][Weight]);
you were trying to retrieve an enmum-inside value like a regular array. the Pets[] is the "parent" of the enum.
edit: nvm ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)