//OnGameModeInIt
LoadTeamLimits();
//OnGameModeExit
SaveTeamLimits();
forward SaveTeamLimits();
public SaveTeamLimits()
{
new INI:File = INI_Open("Teams/TeamLimits.ini");
INI_WriteInt(File, "SouthBoysMembers", SouthBoysM);
INI_WriteInt(File, "YakooMembers", YakooM);
INI_WriteInt(File, "TheTriadsMembers", TheTriadsM);
INI_WriteInt(File, "MafiaMembers", MafiaM);
INI_WriteInt(File, "VagosMembers", VagosM);
INI_WriteInt(File, "CopsMembers", CopsM);
INI_WriteInt(File, "HitmanMembers", HitmanM);
INI_WriteInt(File, "NFSMembers", NFSM);
INI_WriteInt(File, "MotoMembers", MotoM);
INI_Close(File);
return 1;
}
stock LoadTeamLimits(name[], value[])
{
new INI:File = INI_Open("Teams/TeamLimits.ini");
INI_Int("SouthBoysMembers",SouthBoysM);
INI_Int("YakooMembers",YakooM);
INI_Int("TheTriadsMembers", TheTriadsM);
INI_Int("MafiaMembers", MafiaM);
INI_Int("VagosMembers", VagosM);
INI_Int("CopsMembers", CopsM);
INI_Int("HitmanMembers", HitmanM);
INI_Int("NFSMembers", NFSM);
INI_Int("MotoMembers", MotoM);
INI_Close(File);
return 0;
}
stock LoadTeamLimits()
{
new INI:File = INI_Open("Teams/TeamLimits.ini");
INI_Int("SouthBoysMembers",SouthBoysM);
INI_Int("YakooMembers",YakooM);
INI_Int("TheTriadsMembers", TheTriadsM);
INI_Int("MafiaMembers", MafiaM);
INI_Int("VagosMembers", VagosM);
INI_Int("CopsMembers", CopsM);
INI_Int("HitmanMembers", HitmanM);
INI_Int("NFSMembers", NFSM);
INI_Int("MotoMembers", MotoM);
INI_Close(File);
return 0;
}
INI_ParseFile("Teams/TeamLimits.ini", "LoadOneFile", .bPassTag = true);
PHP код:
|
You forgot to load in ongamemodeinit
Код:
INI_ParseFile("Teams/TeamLimits.ini", "LoadOneFile", .bPassTag = true); |
new SouthBoysM;
new YakooM;
new TheTriadsM;
new MafiaM;
new VagosM;
new CopsM;
public OnGameModeInIt()
{
INI_ParseFile("Teams/TeamLimits.ini", "LoadTeamLimits", false, true, true, false);
return 1;
}
public OnGameModeExit()
{
SaveTeamLimits();
return 1;
}
forward LoadTeamLimits(name[],value[]);
public LoadTeamLimits(name[],value[])
{
if(!strcmp(name, "SouthBoysMembers", true)) { SouthBoysM = strval(value); }
if(!strcmp(name, "YakooMembers", true)) { YakooM = strval(value); }
if(!strcmp(name, "TheTriadsMembers", true)) { TheTriadsM = strval(value); }
if(!strcmp(name, "MafiaMembers", true)) { MafiaM = strval(value); }
if(!strcmp(name, "VagosMembers", true)) { VagosM = strval(value); }
if(!strcmp(name, "CopsMembers", true)) { CopsM = strval(value); }
return 0;
}
stock SaveTeamLimits()
{
new INI:File = INI_Open("Teams/TeamLimits.ini");
INI_SetTag(File, "Main");
INI_WriteInt(File, "SouthBoysMembers", SouthBoysM);
INI_WriteInt(File, "YakooMembers", YakooM);
INI_WriteInt(File, "TheTriadsMembers", TheTriadsM);
INI_WriteInt(File, "MafiaMembers", MafiaM);
INI_WriteInt(File, "VagosMembers", VagosM);
INI_WriteInt(File, "CopsMembers", CopsM);
INI_Close(File);
return 1;
}
I tried again something.But it isn't working.Only it saves ,loading failes,my variables are resetting to 0.
Hey!What's wrong here? It is saving but it is not loading. PHP код:
|
INI_ParseFile("Teams/TeamLimits.ini"", "LoadOneFile", .bPassTag = true);
Change your parsefile with this. You did it ?
Код:
INI_ParseFile("Teams/TeamLimits.ini"", "LoadOneFile", .bPassTag = true); |