from dini to y_dini
#1

Hello, can anyone show me how it would look like, if it was to be converted to y_ini instead of dini?

Thanks in advance, just show exampls with Float, and Write to a string etc.



Код:
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|%f|%f|%f|\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][hcocaine],
		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],
		HouseInfo[idx][eHX],
	    HouseInfo[idx][eHY],
	    HouseInfo[idx][eHZ]
		);
	    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: 1 Guest(s)