error 033: array must be indexed
#1

Hey i get this error when compiling:

Код:
error 033: array must be indexed (variable "tmpCName")
Код:
tmpCName = "Sniper ";
tmpCName = tmpCName & pClass4;
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
You can't "AND" a string, only numbers.
thanks, i fixed it with format, but now i have the same error on another code:

Код:
if(PlayerInfo[playerid][Class1] == "1")
{
tmpCName = "[Assault]";
}
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Have you read ANY of the documents on PAWN? It seems you are trying to make up your own language which isn't PAWN at all...
huh wut?
Reply
#4

You can't just do new string[50] = "blablah"... use format.
Reply
#5

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
You can't just do new string[50] = "blablah"... use format.
It looks like you need to read the documentation as well.
Reply
#6

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
You can't just do new string[50] = "blablah"... use format.
no man, the error is in the if statement, the new string = bla just works
Reply
#7

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
It looks like you need to read the documentation as well.
You understood me wrong (as I explained wrong). I meant you can't just do 'new strng[50] = "blahblah";'. If you do that, the string you enter needs to be exactly the size you declared as [50]...

Код:
if(PlayerInfo[playerid][Class1] == "1")
And about that statement... Use strcmp.

pawn Код:
if(!strcmp(PlayerInfo[playerid][Class1],"1",false))
Reply
#8

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
You understood me wrong (as I explained wrong). I meant you can't just do 'new strng[50] = "blahblah";'. If you do that, the string you enter needs to be exactly the size you declared as [50]...

Код:
if(PlayerInfo[playerid][Class1] == "1")
And about that statement... Use strcmp.

pawn Код:
if(!strcmp(PlayerInfo[playerid][Class1],"1",false))
Thanks man, if(!strcmp(PlayerInfo[playerid][Class1],"1",false)) worked
Reply
#9

No problem, you're welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)