Factions problem.. - 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: Factions problem.. (
/showthread.php?tid=270820)
Factions problem.. -
Darklom - 21.07.2011
What could be wrong the faction gets moved up one slot in the factions.cfg
and the current faction looses everything.
pawn Код:
public SaveFamilies()
{
new idx;
new File: file2;
while (idx < sizeof(FamilyInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%s|%s|%f|%f|%f|%f|%f|%f|%s|%s|%s|%s|%s|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
FamilyInfo[idx][FamilyName],
FamilyInfo[idx][FamilyMOTD],
FamilyInfo[idx][FamilySpawn][0],
FamilyInfo[idx][FamilySpawn][1],
FamilyInfo[idx][FamilySpawn][2],
FamilyInfo[idx][FamilyExit][0],
FamilyInfo[idx][FamilyExit][1],
FamilyInfo[idx][FamilyExit][2],
FamilyInfo[idx][FamilyRank1],
FamilyInfo[idx][FamilyRank2],
FamilyInfo[idx][FamilyRank3],
FamilyInfo[idx][FamilyRank4],
FamilyInfo[idx][FamilyRank5],
FamilyInfo[idx][FamilyRank6],
FamilyInfo[idx][FamilySkin1],
FamilyInfo[idx][FamilySkin2],
FamilyInfo[idx][FamilySkin3],
FamilyInfo[idx][FamilySkin4],
FamilyInfo[idx][FamilySkin5],
FamilyInfo[idx][FamilySkin6],
FamilyInfo[idx][FamilyInterior],
FamilyInfo[idx][FamilyDrugs],
FamilyInfo[idx][FamilyMats],
FamilyInfo[idx][FamilyMoney],
FamilyInfo[idx][FamilyLocked],
FamilyInfo[idx][FamilyGun][0],
FamilyInfo[idx][FamilyGun][1],
FamilyInfo[idx][FamilyGun][2],
FamilyInfo[idx][FamilyGun][3],
FamilyInfo[idx][FamilyAmmo][0],
FamilyInfo[idx][FamilyAmmo][1],
FamilyInfo[idx][FamilyAmmo][2],
FamilyInfo[idx][FamilyAmmo][3],
FamilyInfo[idx][FamilyUseable]);
if(idx == 0)
{
file2 = fopen("families.cfg", io_write);
}
else
{
file2 = fopen("families.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}
Re: Factions problem.. -
MadeMan - 21.07.2011
Show loading function.
AW: Factions problem.. -
Adenx - 06.09.2011
I'd be happy if this could get fixed too, that would be helpful!
Re: Factions problem.. -
Kaperstone - 06.09.2011
try this:
pawn Код:
public SaveFamilies()
{
new idx;
new File: file2;
while (idx < sizeof(FamilyInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%s|%s|%f|%f|%f|%f|%f|%f|%s|%s|%s|%s|%s|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",FamilyName,FamilyMOTD,FamilySpawn[0],FamilySpawn[1],FamilySpawn[2],FamilySpawn[3]); // you didnt close it + you didnt put what you want him to show
// and keep it..
FamilyInfo[idx][FamilyName],
FamilyInfo[idx][FamilyMOTD],
FamilyInfo[idx][FamilySpawn[0]],
FamilyInfo[idx][FamilySpawn[1]],//changed here :) (the numbers should be in [ ] because its a part of the verb or whatever it is :\ i think.. lol
FamilyInfo[idx][FamilySpawn[2]],
FamilyInfo[idx][FamilyExit[0]],
FamilyInfo[idx][FamilyExit[1]],
FamilyInfo[idx][FamilyExit[2]],
FamilyInfo[idx][FamilyRank1],
FamilyInfo[idx][FamilyRank2],
FamilyInfo[idx][FamilyRank3],
FamilyInfo[idx][FamilyRank4],
FamilyInfo[idx][FamilyRank5],
FamilyInfo[idx][FamilyRank6],
FamilyInfo[idx][FamilySkin1],
FamilyInfo[idx][FamilySkin2],
FamilyInfo[idx][FamilySkin3],
FamilyInfo[idx][FamilySkin4],
FamilyInfo[idx][FamilySkin5],
FamilyInfo[idx][FamilySkin6],
FamilyInfo[idx][FamilyInterior],
FamilyInfo[idx][FamilyDrugs],
FamilyInfo[idx][FamilyMats],
FamilyInfo[idx][FamilyMoney],
FamilyInfo[idx][FamilyLocked],
FamilyInfo[idx][FamilyGun[0]],
FamilyInfo[idx][FamilyGun[1]],
FamilyInfo[idx][FamilyGun[2]],
FamilyInfo[idx][FamilyGun[3]],
FamilyInfo[idx][FamilyAmmo[0]],
FamilyInfo[idx][FamilyAmmo[1]],
FamilyInfo[idx][FamilyAmmo[2]],
FamilyInfo[idx][FamilyAmmo[3]],
FamilyInfo[idx][FamilyUseable]);
if(idx == 0)
{
file2 = fopen("families.cfg", io_write);
}
else
{
file2 = fopen("families.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}