enum facVars
{
FactionName[64],
FactionRank1[32],
FactionRank2[32],
FactionRank3[32],
FactionRank4[32],
FactionRank5[32]
}
new
facInfo[facVars];
enum facVars
{
FactionName[64],
FactionRank[6][32]
}
new
facInfo[facVars];
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;
}
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;
}
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;
}
CMD:la(playerid, params[])
{
format(facInfo[1][FactionName], 64, "Hello");
return 1;
}
CMD:la(playerid, params[])
{
format(facInfo[1][FactionName], 64, "Hello");
printf("%s", facInfo[1][FactionName]);
return 1;
}
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]);
printf("%s", facNameStr);
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;
}
[16:45:08] /la: Hello
[16:45:11] [SAVE] Player ID 0 saved.
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit: Hello
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit:
[16:45:11] gamemodeexit:
pawn Код:
|
enum facVars
{
FactionName[64],
FactionRank1[32],
FactionRank2[32],
FactionRank3[32],
FactionRank4[32],
FactionRank5[32]
}
new
facInfo[MAX_FACTIONS][facVars]; // This assigns one facVars enumerator for each faction.
My fault, staying up to late...
pawn Код:
|
enum facVars
{
FactionName[64],
FactionRank1[32],
FactionRank2[32],
FactionRank3[32],
FactionRank4[32],
FactionRank5[32]
}
new
facInfo[MAX_FACTIONS][facVars];