error 047: array sizes do not match
#1

When loading: (This causes the error)
pawn Код:
Player[playerid][GroupRank] = dini_Get(string, "GroupRank");
Declaring:
pawn Код:
enum PlayerStatistics
GroupRank[256],
Saving:
pawn Код:
dini_Set(string, "GroupRank", Player[playerid][GroupRank]);

help :P
Reply
#2

This is wrong

pawn Код:
Player[playerid][GroupRank] = dini_Get(string, "GroupRank");
This is correct

pawn Код:
format(Player[playerid][GroupRank], 100, "%s", dini_Get(string, "GroupRank"));
Reply
#3

Works, thank you!

Can you explain me the difference please, because other things works on the way I did like that.

Example:
pawn Код:
Player[playerid][Offence1] = dini_Get(string, "Offence1");
perfectly works
Reply
#4

The difference is that it's a text. There's currently no operator to copy a string to a string because of one reason. Pawn is a typeless 32 bit system, it doesn't know what a string is. For pawn a string is like an array. So in order for you to actually do what you ask it to do you'd have to change every byte.

pawn Код:
for(new i = 0; i < sizeof(array); i++)
{
    array[i] = something[i];
}
Hence the format.

Regards.
Reply
#5

Aha, thank you!

You learn something every day.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)