Reading name/text from a file - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Reading name/text from a file (
/showthread.php?tid=159864)
Reading name/text from a file -
Maxips2 - 14.07.2010
So I got this line:
pawn Code:
HouseInfo[h][hOwner] = dini_Get(file, "Owner");
And I get this error:
pawn Code:
error 006: must be assigned to an array
I tried alot of things, nothing works.
any ideas?
Re: Reading name/text from a file -
Zezombia - 14.07.2010
You've using a string as an integer.
Do:
pawn Code:
strpack(HouseInfo[h][hOwner], dini_Get(file, "Owner"));
https://sampwiki.blast.hk/wiki/Strpack
Re: Reading name/text from a file -
MikkelGutten - 14.07.2010
You can format it:
pawn Code:
format(HouseInfo[h][hOwner], MAX_PLAYER_NAME, "%s", dini_Get(file, "Owner"));
Re: Reading name/text from a file -
Maxips2 - 14.07.2010
Still not working :/
Re: Reading name/text from a file -
MikkelGutten - 14.07.2010
Quote:
Originally Posted by Maxips2
Still not working :/
|
Try add this at your enum then:
Re: Reading name/text from a file -
Maxips2 - 14.07.2010
Dude you rock! that actually worked!

I've been trying to fix this for a whole week!
Thread can be closed!
Re: Reading name/text from a file -
Maxips2 - 14.07.2010
Actually, how do I format just a text, I mean.. I can't use MAX_PLAYER_NAME.
Re: Reading name/text from a file -
dice7 - 14.07.2010
Just write the string length as the second argument in format()