Change to y_ini ( Help )
#1

Код:
public LoadHouses(){
	new arrCoords[23][64];
    new strFromFile2[256];
    new File: file = fopen("Houses.cfg", io_read);
    if (file){
	new idx;
    while (idx < sizeof(HouseInfo)){
	fread(file, strFromFile2);
    split(strFromFile2, arrCoords, '|');
    HouseInfo[idx][hOwned] = strval(arrCoords[0]);
    HouseInfo[idx][hPrice] = strval(arrCoords[1]);
    strmid(HouseInfo[idx][hOwner], arrCoords[2], 0, strlen(arrCoords[2]), 255);
    HouseInfo[idx][hLevel] = strval(arrCoords[3]);
    HouseInfo[idx][hLocked] = strval(arrCoords[4]);
	HouseInfo[idx][hRentable] = strval(arrCoords[5]);
	HouseInfo[idx][hRentPrice] = strval(arrCoords[6]);
	HouseInfo[idx][hGun1] = strval(arrCoords[7]);
	HouseInfo[idx][hGun2] = strval(arrCoords[8]);
	HouseInfo[idx][hGun3] = strval(arrCoords[9]);
	HouseInfo[idx][hMoney] = strval(arrCoords[10]);
	HouseInfo[idx][hEntranceX] = floatstr(arrCoords[11]);
	HouseInfo[idx][hEntranceY] = floatstr(arrCoords[12]);
	HouseInfo[idx][hEntranceZ] = floatstr(arrCoords[13]);
	HouseInfo[idx][hEntranceA] = floatstr(arrCoords[14]);
	HouseInfo[idx][hExitX] = floatstr(arrCoords[15]);
	HouseInfo[idx][hExitY] = floatstr(arrCoords[16]);
	HouseInfo[idx][hExitZ] = floatstr(arrCoords[17]);
	HouseInfo[idx][hExitA] = floatstr(arrCoords[18]);
	HouseInfo[idx][hInt] = strval(arrCoords[19]);
	HouseInfo[idx][hWorld] = strval(arrCoords[20]);
	HouseInfo[idx][hInsideInt] = strval(arrCoords[21]);
	HouseInfo[idx][hInsideWorld] = strval(arrCoords[22]);
	if(HouseInfo[idx][hOutsideIcon]) DestroyDynamicPickup(HouseInfo[idx][hOutsideIcon]);
    if(HouseInfo[idx][hInsideIcon]) DestroyDynamicPickup(HouseInfo[idx][hInsideIcon]);
    HouseInfo[idx][hOutsideIcon] = CreateDynamicPickup(1273, 1, HouseInfo[idx][hEntranceX], HouseInfo[idx][hEntranceY], HouseInfo[idx][hEntranceZ], HouseInfo[idx][hWorld]);
    HouseInfo[idx][hInsideIcon] = CreateDynamicPickup(1273, 1, HouseInfo[idx][hExitX], HouseInfo[idx][hExitY], HouseInfo[idx][hExitZ], HouseInfo[idx][hInsideWorld]);
	idx++;}fclose(file);}
	return 1;}

public SaveHouses(){
    new idx;new File: file2;
	while (idx < sizeof(HouseInfo)){
    new coordsstring[512];
    format(coordsstring, sizeof(coordsstring), "%d|%d|%s|%d|%d|%d|%d|%d|%d|%d|%d|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d\r\n",
   	HouseInfo[idx][hOwned],
   	HouseInfo[idx][hPrice],
   	HouseInfo[idx][hOwner],
   	HouseInfo[idx][hLevel],
   	HouseInfo[idx][hLocked],
	HouseInfo[idx][hRentable],
	HouseInfo[idx][hRentPrice],
	HouseInfo[idx][hGun1],
	HouseInfo[idx][hGun2],
	HouseInfo[idx][hGun3],
	HouseInfo[idx][hMoney],
	HouseInfo[idx][hEntranceX],
	HouseInfo[idx][hEntranceY],
	HouseInfo[idx][hEntranceZ],
	HouseInfo[idx][hEntranceA],
	HouseInfo[idx][hExitX],
	HouseInfo[idx][hExitY],
	HouseInfo[idx][hExitZ],
	HouseInfo[idx][hExitA],
	HouseInfo[idx][hInt],
	HouseInfo[idx][hWorld],
	HouseInfo[idx][hInsideInt],
	HouseInfo[idx][hInsideWorld]);
    if(idx == 0){
	file2 = fopen("Houses.cfg", io_write);}
	else{
	file2 = fopen("Houses.cfg", io_append);}
	fwrite(file2, coordsstring);idx++;fclose(file2);}
	return 1;}
How transform this in y_ini ? please help me !!
Reply
#2

Click HERE!
Reply
#3

I Don't understand from that tutorial. Please give me an example here... please !
Reply
#4

Help !
Reply
#5

help me please... i will give +rep !!!!!!!!!!!!!!!!
Reply
#6

Quote:
Originally Posted by Bect
Посмотреть сообщение
help me please... i will give +rep !!!!!!!!!!!!!!!!
This cant be done with y_ini, i have researched about it. Unless you ask ****** for his confirm.
Reply
#7

really ? . i don't belive !
Reply
#8

Quote:
Originally Posted by Bect
Посмотреть сообщение
really ? . i don't belive !
Thats your problem.
Reply
#9

well.. that request INI_READ.. and i don't know how to use this...
PS: look at your reputation !
Reply
#10

Quote:
Originally Posted by Bect
Посмотреть сообщение
well.. that request INI_READ.. and i don't know how to use this...
PS: look at your reputation !
Trust me, i tried to do exact same thing.. Thx btw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)