Oh noes (Variable must be indexed)
#1

Never though I would give up this easily. But who never asks, never wins.

I get this error:

Код:
C:\Users\Hiddos\Hiddos\scripts\gamemodes\CODSW11.pwn(4201) : error 033: array must be indexed (variable "RankAmounts")
I can't seem to find what's wrong.
Line 4201:
pawn Код:
if(GetPVarInt(playerid,"Kills") >= RankAmounts[r])
RankAmounts:
pawn Код:
new RankAmounts[][] = {
    {50},
    {125},
    {200},
    {300},
    {450},
    {700},
    {1000}
};
Yes, I am an idiot. And no, I don't see a reason why an idiot isn't allowed to ask for help.
Reply
#2

Where you define RankAmounts, you have this:

pawn Код:
RankAmounts[][]
Meaning there should be two parameters when you list them, but there's only one and you also use only one where you compare the two variables.
Reply
#3

You declared a two dimensional array:
Код:
new RankAmounts[][] = {
And you doing something like this :
Код:
if(GetPVarInt(playerid,"Kills") >= RankAmounts[r]) //<---see? single []
it should be something like this:
Код:
if(GetPVarInt(playerid,"Kills") >= RankAmounts[0][r])
Reply
#4

Fixed it, thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)