Must be assignet to an array, please help...
#1

hi,

it gives me the "must be assignet to an array" error.
Can someone please tell me how to fix this?

Code:
pawn Код:
enum Data
{
   HousePassword
}
new hInfo[MAX_HOUSES][Data];

new HousePassword__[40][MAX_PLAYERS];
HousePassword__[40][h]="--";

hInfo[h][HousePassword] = HousePassword__[h];//here is the error!!
thanks!
Reply
#2

try this
Код:
enum Data
{
   HousePassword
}
new hInfo[MAX_HOUSES][Data];

new HousePassword__[MAX_PLAYERS][40];
HousePassword__[h]="--";

hInfo[h][HousePassword] = HousePassword__[h];
Reply
#3

i made an error while typing in my first post and you fixed it for me thanks.
But the error like the title says still occurs...

thanks for ur answer but any other suggestions?
Reply
#4

Yeah, sorry, i missed an important aspect. hInfo[h][HousePassword] is not an array,
so you cannot assign another array / string to it.
Try doing something like this:

Код:
enum Data
{
   // ... everything else, but not the password
}
new hInfo[MAX_HOUSES][Data];
new hPassword[MAX_HOUSES][40];


new housePasswords_[MAX_PLAYERS][40];
housePasswords_[playerid] = "--";

hPassword[houseid] = housePasswords_[playerid];
Reply
#5

well thanks but that just wont save my problem...
Im asking here so i dont have to change the whole enum variables.
Cause there are like 20 variables in the enum, just like the HousePassword that give the same error.
I only posted the HousePassword variable as an example cause i know how to fix the other variables as well if someone shows me how to fix this one.

Please, i really need to fix
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)