Must be assigned to an array - 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 assigned to an array (
/showthread.php?tid=321802)
Must be assigned to an array -
jameskmonger - 28.02.2012
pawn Код:
for(new i = 0; i < 13; i++) {
new i2 = i;
i2 += 11;
PlayerData[playerid][pWeapons][i] = field[i2];
}
Quote:
error 006: must be assigned to an array
|
error is on line "PlayerData[pla..."
Re: Must be assigned to an array -
Roperr - 28.02.2012
Show me how you define PlayerData.
Re: Must be assigned to an array -
jameskmonger - 28.02.2012
Ah, I've got it, replacing the line with this:
pawn Код:
PlayerData[playerid][pWeapons][i] = strval(field[i2]);
has fixed the error. Thanks for the help anyway, have some rep for trying
Re: Must be assigned to an array -
Roperr - 28.02.2012
Quote:
Originally Posted by jameskmonger
Ah, I've got it, replacing the line with this:
pawn Код:
PlayerData[playerid][pWeapons][i] = strval(field[i2]);
has fixed the error. Thanks for the help anyway, have some rep for trying 
|
I was gonna tell you that

, since I realised it was a string you tried saving, and storing like you used to in arrays, doesn't work

.