(dFile) error 047: array sizes do not match, or destination array is too small
#1

So I'm trying to read a string with dFile but it's giving me the 047 error.

Here's my dFile code:
pawn Код:
PlayerInfo[playerid][pBanReason] = dfile_ReadString("BanReason");
And in my enum for playerinfo, I've got:
Код:
pBanReason[126]
Not sure why it's giving me this error. (I'm not gonna listen to anyone who tells to me to use a different file system, I'm trying to learn dFile at the moment since y_ini annoyed me)
Reply
#2

What is 047 error?
Reply
#3

error 047: array sizes do not match, or destination array is too small
Reply
#4

pawn Код:
format(PlayerInfo[playerid][pBanReason],sizeof(PlayerInfo[playerid][pBanReason]),"%s",dfile_ReadString("BanReason"));
Reply
#5

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
format(PlayerInfo[playerid][pBanReason],sizeof(PlayerInfo[playerid][pBanReason]),"%s",dfile_ReadString("BanReason"));
Код:
error 001: expected token: "]", but found "-identifier-"
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply
#6

pawn Код:
format(PlayerInfo[playerid][pBanReason],126,"%s",dfile_ReadString("BanReason"));
Reply
#7

Okay that works thanks, but I'm a bit confused.
Would that set the enum from the info in the file, or set the file to the info from the enum?
Reply
#8

Set the enum from the string in the file.
Reply
#9

Wait, got it thankyou
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)