26.12.2013, 07:53
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.
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."); }