public OnPlayerLogin(playerid, password[])
{
new tmp2[64];
new string2[256];
new playername2[MAX_PLAYER_NAME];
new playernamesplit[3][MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
split(playername2, playernamesplit, '_');
format(string2, sizeof(string2), "users/%s.ini", playername2);
if(dini_Exists(string2))
{
[ ... ]
PlayerInfo[playerid][pMarried] = dini_Int(string2, "Married");
PlayerInfo[playerid][pMarriedTo] = dini_Get(string2, "MarriedTo");
PlayerInfo[playerid][pNote1] = dini_Get(string2, "Note1");
PlayerInfo[playerid][pNote1s] = dini_Int(string2, "Note1s");
PlayerInfo[playerid][pNote2] = dini_Get(string2, "Note2");
PlayerInfo[playerid][pNote2s] = dini_Int(string2, "Note2s");
PlayerInfo[playerid][pNote3] = dini_Get(string2, "Note3");
PlayerInfo[playerid][pNote3s] = dini_Int(string2, "Note3s");
PlayerInfo[playerid][pNote4] = dini_Get(string2, "Note4");
PlayerInfo[playerid][pNote4s] = dini_Int(string2, "Note4s");
PlayerInfo[playerid][pNote5] = dini_Get(string2, "Note5");
PlayerInfo[playerid][pNote5s] = dini_Int(string2, "Note5s");
[ ... ]
}
[ ... ]
enum pInfo
{
[ ... ]
pMarried,
pMarriedTo[128],
pNote1[128],
pNote1s,
pNote2[128],
pNote2s,
pNote3[128],
pNote3s,
pNote4[128],
pNote4s,
pNote5[128],
pNote5s,
[ ... ]
};
C:\Documents and Settings\Administrator\Desktop\ \gamemodes\BBC1.pwn(10766) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Administrator\Desktop\ \gamemodes\BBC1.pwn(10767) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Administrator\Desktop\ \gamemodes\BBC1.pwn(10769) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Administrator\Desktop\ \gamemodes\BBC1.pwn(10771) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Administrator\Desktop\ \gamemodes\BBC1.pwn(10773) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Administrator\Desktop\ \gamemodes\BBC1.pwn(10775) : error 047: array sizes do not match, or destination array is too small Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
Originally Posted by Chuck_Taylor
Whats this? [ ... ]
|
Originally Posted by WrathOfGenesis
Telling us the line numbers could help us to identify where the problem is
|
PlayerInfo[playerid][pMarriedTo] = dini_Get(string2, "MarriedTo"); //error line
PlayerInfo[playerid][pNote1] = dini_Get(string2, "Note1"); //error line
PlayerInfo[playerid][pNote1s] = dini_Int(string2, "Note1s");
PlayerInfo[playerid][pNote2] = dini_Get(string2, "Note2"); //error line
PlayerInfo[playerid][pNote2s] = dini_Int(string2, "Note2s");
PlayerInfo[playerid][pNote3] = dini_Get(string2, "Note3"); //error line
PlayerInfo[playerid][pNote3s] = dini_Int(string2, "Note3s");
PlayerInfo[playerid][pNote4] = dini_Get(string2, "Note4"); //error line
PlayerInfo[playerid][pNote4s] = dini_Int(string2, "Note4s");
PlayerInfo[playerid][pNote5] = dini_Get(string2, "Note5"); //error line
PlayerInfo[playerid][pNote5s] = dini_Int(string2, "Note5s");
Originally Posted by Seif_
Use strmid when using dini_Get with the string variables.
|
stock dini_Get(filename[],key[]) {
new tmpres[DINI_MAX_STRING];
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return tmpres;
new File:fohnd;
fohnd=fopen(filename,io_read);
if (!fohnd) return tmpres;
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
/* We've got what we need */
DINI_StripNewLine(tmpres);
strmid(tmpres, tmpres, key_length + 1, strlen(tmpres), DINI_MAX_STRING); // STRMID FUNC