Y_INI: tag mismatch.
#1

pawn Код:
enum SB_Type {RED_TWI, DES_TWI}
enum SB_Data {sbName[MAX_PLAYER_NAME], sbMinute, sbSecond}
new ScoreBoard[SB_Type][10][SB_Data];
pawn Код:
public LoadData_ScoreBoard(name[], value[])
{
    new str[2][MAX_PLAYER_NAME];
    for(new t; t < 2; t++) for(new i; i < 10; i++)
    {
        format(str[0], 24, "name_%i_%i", t+1, i+1);
        INI_String(str[0], ScoreBoard[t][i][sbName], MAX_PLAYER_NAME);
       
        format(str[1], 24, "minute_%i_%i", t+1, i+1);
        INI_Int(str[1], ScoreBoard[t][i][sbMinute]);
       
        format(str[1], 24, "second_%i_%i", t+1, i+1);
        INI_Int(str[1], ScoreBoard[t][i][sbSecond]);
    }
    return 1;
}
I'm getting 2 tag mismatch warnings on the INI_String line, and 1 tag mismatch on each of the INI_Int lines. I feel like this is going to be something very simple, but I can't see it. Note: I haven't been scripting much lately... XD
Reply
#2

pawn Код:
INI_String(str[0], ScoreBoard[t][i][sbName], MAX_PLAYER_NAME);
Inputting t directly in first param or into array will cause tag mismatch.
Maybe you are trying to do this:
pawn Код:
format(str[0], 24, "name_%i_%i", t+1, i+1);
        if(! t) INI_String(str[0], ScoreBoard[RED_TWI][i][sbName], MAX_PLAYER_NAME);
        else INI_String(str[0], ScoreBoard[DES_TWI][i][sbName], MAX_PLAYER_NAME);
Or the best way is:
Код:
	    format(str[0], 24, "name_%i_%i", t+1, i+1);
	    INI_String(str[0], ScoreBoard[SB_Type: t][i][sbName], MAX_PLAYER_NAME);
Similar for INI_Int part.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)