Faction doesn't save - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Faction doesn't save (
/showthread.php?tid=624979)
Faction doesn't save -
NealPeteros - 26.12.2016
Here's my saving function
PHP код:
forward SaveFaction(id);
public SaveFaction(id)
{
new file[40];
format(file, sizeof(file), FPath, id);
new INI:File = INI_Open(file);
INI_SetTag(File,"data");
INI_WriteInt(File, "Members",FacInfo[id][fMembers]);
INI_WriteString(File,"Leader",FacInfo[id][fLeader]);
return 1;
}
Here's FPath
PHP код:
#define FPath "/factions/%d.ini"
Problem here is that it doesn't create the .ini file. Yes, I made a 'factions' folder in my scriptfiles
Re: Faction doesn't save -
StrikerZ - 26.12.2016
PHP код:
forward SaveFaction(id);
public SaveFaction(id)
{
new file[40];
format(file, sizeof(file), FPath, id);
new INI:File = INI_Open(file);
INI_SetTag(File,"data");
INI_WriteInt(File, "Members",FacInfo[id][fMembers]);
INI_WriteString(File,"Leader",FacInfo[id][fLeader]);
INI_Close(File);
return 1;
}
PHP код:
#define FPath "/factions/%i.ini"