Making this load OnGamemodeinit
#3

Here is the function that should load it into the gamemode, I tried fiddling with the LoadFurn so it fits into LoadProperty but I can't do it.. it also says that the ID is undefined.

Код:
public LoadProperty()
{
    printf("Loading Properties and furniture...");
	new arrCoords[45][64], strFromFile2[256];
	new File: file = fopen("property.ini", io_read);
	if (file)
	{
		new idx;
		while (idx < sizeof(HouseInfo))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, ',');
			strmid(HouseInfo[idx][hName], arrCoords[0], 0, strlen(arrCoords[0]), 255);
			HouseInfo[idx][hLock] = strval(arrCoords[1]);
			HouseInfo[idx][hHours] = strval(arrCoords[2]);
			HouseInfo[idx][hPrice] = strval(arrCoords[3]);
			HouseInfo[idx][hEnterX] = floatstr(arrCoords[4]);
			HouseInfo[idx][hEnterY] = floatstr(arrCoords[5]);
			HouseInfo[idx][hEnterZ] = floatstr(arrCoords[6]);
			HouseInfo[idx][hExitX] = floatstr(arrCoords[7]);
			HouseInfo[idx][hExitY] = floatstr(arrCoords[8]);
			HouseInfo[idx][hExitZ] = floatstr(arrCoords[9]);
			strmid(HouseInfo[idx][hOwner], arrCoords[10], 0, strlen(arrCoords[10]), 255);
			HouseInfo[idx][hOwned] = strval(arrCoords[11]);
			HouseInfo[idx][hRentable] = strval(arrCoords[12]);
			HouseInfo[idx][hRent] = strval(arrCoords[13]);
			HouseInfo[idx][hInterior] = strval(arrCoords[14]);
			HouseInfo[idx][hMoney] = strval(arrCoords[15]);
			HouseInfo[idx][hGun][0] = strval(arrCoords[16]);
			HouseInfo[idx][hGunAmmo][0] = strval(arrCoords[17]);
			HouseInfo[idx][hWeed] = strval(arrCoords[18]);
			HouseInfo[idx][hCocaine] = strval(arrCoords[19]);
			HouseInfo[idx][hCrack] = strval(arrCoords[20]);
			HouseInfo[idx][hArmour] = floatstr(arrCoords[21]);
			HouseInfo[idx][hType] = strval(arrCoords[22]);
			HouseInfo[idx][hEInt] = strval(arrCoords[23]);
			HouseInfo[idx][hEWorld] = strval(arrCoords[24]);
			HouseInfo[idx][hTime] = strval(arrCoords[25]);
			HouseInfo[idx][hGun][1] = strval(arrCoords[26]);
			HouseInfo[idx][hGunAmmo][1] = strval(arrCoords[27]);
			HouseInfo[idx][hGun][2] = strval(arrCoords[28]);
			HouseInfo[idx][hGunAmmo][2] = strval(arrCoords[29]);
			HouseInfo[idx][hGun][3] = strval(arrCoords[30]);
			HouseInfo[idx][hGunAmmo][3] = strval(arrCoords[31]);
			HouseInfo[idx][hComd] = strval(arrCoords[32]);
			HouseInfo[idx][hGun][4] = strval(arrCoords[33]);
			HouseInfo[idx][hGunAmmo][4] = strval(arrCoords[34]);
			HouseInfo[idx][hGun][5] = strval(arrCoords[35]);
			HouseInfo[idx][hGunAmmo][5] = strval(arrCoords[36]);
			HouseInfo[idx][hGun][6] = strval(arrCoords[37]);
			HouseInfo[idx][hGunAmmo][6] = strval(arrCoords[38]);
			HouseInfo[idx][hGun][7] = strval(arrCoords[39]);
			HouseInfo[idx][hGunAmmo][7] = strval(arrCoords[40]);
			HouseInfo[idx][hGun][8] = strval(arrCoords[41]);
			HouseInfo[idx][hGunAmmo][8] = strval(arrCoords[42]);
			HouseInfo[idx][hGun][9] = strval(arrCoords[43]);
			HouseInfo[idx][hGunAmmo][9] = strval(arrCoords[44]);
		    	new string[128];
		    	format(string, sizeof(string), "housedata/%d.ini", id);
		    	if(DOF2_FileExists(string))
		    	{
		        	LoadFurn(id);
		    	}
			idx++;
		}
 }
	fclose(file);
	return 1;
}
Reply


Messages In This Thread
Making this load OnGamemodeinit - by Goosie - 11.02.2015, 02:41
Re: Making this load OnGamemodeinit - by Eth - 11.02.2015, 03:59
Re: Making this load OnGamemodeinit - by Goosie - 11.02.2015, 05:17

Forum Jump:


Users browsing this thread: 2 Guest(s)