Reading name/text from a file
#1

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?
Reply
#2

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
Reply
#3

You can format it:

pawn Code:
format(HouseInfo[h][hOwner], MAX_PLAYER_NAME, "%s", dini_Get(file, "Owner"));
Reply
#4

Still not working :/
Reply
#5

Quote:
Originally Posted by Maxips2
View Post
Still not working :/
Try add this at your enum then:

pawn Code:
hOwner[MAX_PLAYER_NAME],
Reply
#6

Dude you rock! that actually worked!
I've been trying to fix this for a whole week!

Thread can be closed!
Reply
#7

Actually, how do I format just a text, I mean.. I can't use MAX_PLAYER_NAME.
Reply
#8

Just write the string length as the second argument in format()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)