My Project Could't Save when i relog
#1

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.
Reply
#2

Anyone can help me ?
Reply
#3

Show your function which loads and saves the things created
Reply
#4

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.");
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)