Help: error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
#1

I don't know why i get this, so i need your help. After a long break from scripting, i just dont get it :P

This is my enums:

pawn Код:
enum PlayerInfo
{
    pHello
}
new pInfo[MAX_PLAYERS][PlayerInfo];
This is the only "new" line of anything with "PlayerInfo" in.

My Command:

The error is on this line:
pawn Код:
PlayerInfo[playerid][pHello] = 1;
pawn Код:
if (strcmp("/Hello", cmdtext, true, 10) == 0)
    {
        PlayerInfo[playerid][pHello] = 1;
    }
    return 1;
Also, i have always used the zcmd include when making commands, so i am not sure if this is the correct way to use "PlayerInfo" in a command like this. Theres probably a easy way to fix this :P Well thanks for your time!
Reply
#2

Change to:

PHP код:
pInfo[playerid][pHello] = 1
Reply
#3

You can use that

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
Change to:

PHP код:
pInfo[playerid][pHello] = 1
or change

pawn Код:
enum PlayerInfo
{
    pHello
}
new pInfo[MAX_PLAYERS][PlayerInfo];
To

pawn Код:
enum pInfo
{
    pHello
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)