It isn't, but I appreciate your input nonetheless. Could you perhaps assist me on another problem without me having to open a new topic? Logically, this works in my mind, and it compiles perfectly, however, it doesn't seem to work in-game.. What seems to be the problem? (it creates the file perfectly, ect, just doesn't save when I type /la)
pawn Код:
public OnGameModeInit()
{
if(fexist("RPMod/Factions/FactionInfo.ini"))
{
INI_ParseFile("RPMod/Factions/FactionInfo.ini", "LoadFactions");
}
else
{
new
INI:facFile = INI_Open("RPMod/Factions/FactionInfo.ini");
INI_Close(facFile);
}
return true;
}
pawn Код:
public OnGameModeExit()
{
new
INI:facFile = INI_Open("RPMod/Factions/FactionInfo.ini"),
facNameStr[64];
for( new f; f < MAX_FACTIONS; f++ )
{
format(facNameStr, sizeof(facNameStr), "%s", facInfo[f][FactionName]);
INI_WriteString(facFile, "FactionName", facNameStr);
INI_WriteString(facFile, "FactionRank1", facInfo[f][FactionRank1]);
INI_WriteString(facFile, "FactionRank2", facInfo[f][FactionRank2]);
INI_WriteString(facFile, "FactionRank3", facInfo[f][FactionRank3]);
INI_WriteString(facFile, "FactionRank4", facInfo[f][FactionRank4]);
INI_WriteString(facFile, "FactionRank5", facInfo[f][FactionRank5]);
}
INI_Close(facFile);
return true;
}
pawn Код:
forward LoadFactions(name[], value[]);
public LoadFactions(name[], value[])
{
for( new f; f < MAX_FACTIONS; f++ )
{
INI_String("FactionName", facInfo[f][FactionName], 64);
INI_String("FactionRank1", facInfo[f][FactionRank1], 32);
INI_String("FactionRank2", facInfo[f][FactionRank2], 32);
INI_String("FactionRank3", facInfo[f][FactionRank3], 32);
INI_String("FactionRank4", facInfo[f][FactionRank4], 32);
INI_String("FactionRank5", facInfo[f][FactionRank5], 32);
}
return true;
}
pawn Код:
CMD:la(playerid, params[])
{
format(facInfo[1][FactionName], 64, "Hello");
return 1;
}