[HELP] INI_Parsfile
#1

Hi, i have some problem with loading ... Let me explain...

I have this code:

Код:
#define MAX_SOMEINFO 50



enum SomeInfo
{
    SomeString[64],
    SomeString2[16],
    SomeValue

}
Now, i need to load saved files (SAVING IS WORKING SO I DONT POST IT HERE),
i tried 3 kinds of ParseFile, 0 of them works how i want. I tried many combinations,
not only this 3 but nothing work ..

Код:
public OnGameModeInit()
{

    
	INI_ParseFile("SomeInfos/SI1.ini", "LoadSI1_data", .bExtra = true, .extra = 0); // THIS NO LOAD SomeString AND NO LOAD pickup and 3Dtext
	INI_ParseFile("SomeInfos/SI1.ini", "LoadSI1_data", .bPassTag = true); //THIS LOAD SomeString, but NO LOAD pickup and 3Dtext
	INI_ParseFile("SomeInfos/SI1.ini", "LoadSI1_data", .bExtra = true, .extra = 1); // THIS LOAD pickup and 3Dtext but NO LOAD SomeString
	return 1;

}
Here i need to load data and make pickup with SomeValue help.

Код:
forward LoadSI1_data(tag[], name[], value[]);
public LoadSI1_data(tag[], name[], value[])
{

	INI_String("SomeString", SomeInfo[1][SomeString], 64);
	INI_String("SomeString2", SomeInfo[1][SomeString2], 16);
    INI_Int("SomeValue", SomeInfo[1][SomeValue]);


	if(SomeInfo[1][SomeValue] == 0)
	{
	    new text[128], 3DS1;
		SomePickup[1] = CreatePickup(19524,1,1952.8840,-2178.9063,13.5469,0);
        format(text, sizeof(text), "{FFDD00}%s\n", SomeInfo[1][SomeString]);
        3DS1 = Create3DTextLabel(text, 0xFFFFFFFF, 1952.8840, -2178.9063, 15, 15.0, 0, 1);
		return 1;

	}
	else if(SomeInfo[1][SomeValue] == 1)
	{
		new text[128], 3DS12;
		PropPickup[1] = CreatePickup(19523,1,1952.8840,-2178.9063,13.5469,0); 
		format(PIDstring1, sizeof(PIDstring1), "{FFDD00}%s",SomeInfo[1][SomeString2]);
		3DSI2 = Create3DTextLabel(PIDstring1, 0xFFFFFFFF, 1952.8840, -2178.9063, 15, 15.0, 0, 1);
		return 1;
	}

	return 1;

}
THE PROBLEM IS WITH PARSEFILE, in some case it LOADS STRING but NOT LOAD PICKUP and 3DTEXT
or LOAD PICKUP and 3DTEXT but NOT LOAD STRING...

I need to load evrything ... Any idea?
Reply
#2

Thank you!
I tried to load it all from one function so it's not that confusing for me ... Nevermind.

Can i just ask something?

Is it better to use .txt file to save every SOMEINFO in one file and save it/load it all at once

or

use .ini file for each SOMEINFO and save it when PLAYER change SOMEINFO?
(So i have 50 .ini files)
Reply
#3

try to use mysql, i used it and working good.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)