Create Faction errors
#1

Yeah hey, recently made a thread about saving problems, these are now fixed but I've got these now errors now, which is related to this command as far as I know.

Errors
pawn Код:
: error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
 error 047: array sizes do not match, or destination array is too small
 error 047: array sizes do not match, or destination array is too small
 error 047: array sizes do not match, or destination array is too small
 error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
And this is the command, I add this and the errors appear.

pawn Код:
command(createfaction, playerid, params[])
{
    new fname[150], r1[150], r2[150], r3[150], r4[150], r5[150], r6[150], r7[150];
    if( sscanf( params, "zzzzzzzz", fname, r1, r2, r3, r4, r5, r6, r7))
    CreateFaction(fname, r1, r2, r3, r4, r5, r6, r7);
    SendClientMessage(playerid, COLOUR_RED, "DONE" );
    return 1;
}
Lines the errors appear on...
pawn Код:
Faction[i][FactionName] = dini_Get(Factionfile, "FactionName" );
            Faction[i][FactionRank1] = dini_Get(Factionfile, "FactionRank1" );
            Faction[i][FactionRank2] = dini_Get(Factionfile, "FactionRank2" );
            Faction[i][FactionRank3] = dini_Get(Factionfile, "FactionRank3" );
            Faction[i][FactionRank4] = dini_Get(Factionfile, "FactionRank4" );
            Faction[i][FactionRank5] = dini_Get(Factionfile, "FactionRank5" );
            Faction[i][FactionRank6] = dini_Get(Factionfile, "FactionRank6" );
            Faction[i][FactionRank7] = dini_Get(Factionfile, "FactionRank7" );
Reply
#2

Sorry for the double post but I need this fixed :S?
Reply
#3

Use format. Like this:

pawn Код:
format(Faction[i][FactionName], MAX_STRING, "%s",dini_Get(Factionfile, "FactionName" ));
format(Faction[i][FactionRank1], MAX_STRING, "%s",dini_Get(Factionfile, "FactionRank1" ));
format(Faction[i][FactionRank2], MAX_STRING, "%s",dini_Get(Factionfile, "FactionRank2" ));
format(Faction[i][FactionRank3], MAX_STRING, "%s",dini_Get(Factionfile, "FactionRank3" ));
format(Faction[i][FactionRank4], MAX_STRING, "%s",dini_Get(Factionfile, "FactionRank4" ));
format(Faction[i][FactionRank5], MAX_STRING, "%s",dini_Get(Factionfile, "FactionRank5" ));
format(Faction[i][FactionRank6], MAX_STRING, "%s",dini_Get(Factionfile, "FactionRank6" ));
format(Faction[i][FactionRank7], MAX_STRING, "%s",dini_Get(Factionfile, "FactionRank7" ));
Reply
#4

It takes away the errors but when I use the command in game it says: "Strings without a length are depreciated please add a destination size." in the server.exe
Reply
#5

LOL forgot this, add this on top, below includes:
pawn Код:
#define MAX_STRING 128
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)