My Project Could't Save when i relog - 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: My Project Could't Save when i relog (
/showthread.php?tid=483460)
My Project Could't Save when i relog -
botak - 26.12.2013
In my gamemodes, when i create house,garage,biz,mapicon, and door. the project not be save and not be load when i relog. please help me. REP+ when it fix.
Re: My Project Could't Save when i relog -
botak - 26.12.2013
Anyone can help me ?
Re: My Project Could't Save when i relog -
ProjectNewYork - 26.12.2013
Show your function which loads and saves the things created
Re: My Project Could't Save when i relog -
botak - 26.12.2013
here we go
thats for example housing system, because garage,door,mapicon, and biz have a same bug
Код:
stock SaveHouses()
{
new idx = 1, File:file;
new string[256];
while(idx < MAX_HOUSES)
{
format(string, sizeof(string), "%d|%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
HouseInfo[idx][hLevel],
HouseInfo[idx][hPrice],
HouseInfo[idx][hStatus],
HouseInfo[idx][hOwner],
HouseInfo[idx][hX],
HouseInfo[idx][hY],
HouseInfo[idx][hZ],
HouseInfo[idx][hMoney],
HouseInfo[idx][hMaterials],
HouseInfo[idx][hWeed],
HouseInfo[idx][hCrack],
HouseInfo[idx][hGun][0],
HouseInfo[idx][hGunAmmo][0],
HouseInfo[idx][hGun][1],
HouseInfo[idx][hGunAmmo][1],
HouseInfo[idx][hGun][2],
HouseInfo[idx][hGunAmmo][2],
HouseInfo[idx][hGun][3],
HouseInfo[idx][hGunAmmo][3],
HouseInfo[idx][hGun][4],
HouseInfo[idx][hGunAmmo][4]
);
if(idx == 1)
{
file = fopen("houses.cfg", io_write);
}
else
{
file = fopen("houses.cfg", io_append);
}
fwrite(file, string);
fclose(file);
idx++;
}
print("Houses saved successfully.");
}