Error: invalid subscript (not an array or too many subscripts): "pInfo"
#1

I've been struggling with this error now for a couple off hours and i can't seem to be finding a solution, (BTW i'm new in scripting) So i'm posting this

The error:
invalid subscript (not an array or too many subscripts): "pInfo"

Line 139 Where the error is:

if(pInfo[i][pFaction] == 2)

Full code:

public PoliceBroadcast(color,const string[],level)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pFaction] == 2)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
Reply
#2

Can you show me where you declare pInfo?
Reply
#3

enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pFac,
pLead,
pBanned
};
Reply
#4

I see. That's not quite how you do it.

After the enum, write: new PlayerInfo[MAX_PLAYERS][pInfo];

Then, in the error line, replace pInfo with PlayerInfo.
Reply
#5

It's working now Thanks +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)