Must be assignet to an array, please help... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Must be assignet to an array, please help... (
/showthread.php?tid=378915)
Must be assignet to an array, please help... -
PawnoQ - 19.09.2012
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!
AW: Must be assignet to an array, please help... -
Blowfish - 19.09.2012
try this
Код:
enum Data
{
HousePassword
}
new hInfo[MAX_HOUSES][Data];
new HousePassword__[MAX_PLAYERS][40];
HousePassword__[h]="--";
hInfo[h][HousePassword] = HousePassword__[h];
Re: Must be assignet to an array, please help... -
PawnoQ - 19.09.2012
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?
AW: Must be assignet to an array, please help... -
Blowfish - 19.09.2012
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];
Re: Must be assignet to an array, please help... -
PawnoQ - 19.09.2012
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