y_ini - How to load created map
#1

Hi guys.

I'm making a InGame Object Creator and here is my code to save created objects:


Код:
new INI:ini_doeMap = INI_Open(mapName);
for(new i = 0; i < doe_Index + 1; i++)
{
new stringName[30], stringParams[256];
format(stringName, sizeof(stringName), "doe_Object[%i]", i);
format(stringParams, sizeof(stringParams), "CreateObject(%i, %f, %f, %f, %f, %f, %f);", DOE[i][DOE_ModelID], DOE[i][DOE_X], DOE[i][DOE_Y], DOE[i][DOE_Z], DOE[i][DOE_rX], DOE[i][DOE_rY], DOE[i][DOE_rZ]);
INI_WriteString(ini_doeMap, stringName, stringParams);
}
INI_Close(ini_doeMap);
It works great, but I have no idea how to load the objects back to the game from file (I'm not much experienced about y_ini)

Saved file with the objects:
Код:
doe_Object[1] = CreateObject(3035, -2003.729370, 433.925506, 35.015625, 0, 0, 0);
doe_Object[2] = CreateObject(3035, -1998.181884, 438.433471, 35.637966, 0, 0, 0);
doe_Object[3] = CreateObject(3034, -2005.000488, 444.294250, 35.015625, 0, 0, 0);
doe_Object[4] = CreateObject(3036, -1997.110839, 444.868347, 35.015625, 0, 0, 0);
doe_Object[5] = CreateObject(3034, -2005.863647, 449.276489, 35.015625, 0, 0, 0);
doe_Object[6] = CreateObject(3034, -2005.863647, 449.276489, 35.015625, 0, 0, 0);
doe_Object[7] = CreateObject(3034, -2005.863647, 449.276489, 35.015625, 0, 0, 0);
doe_Object[8] = CreateObject(3034, -2000.441772, 454.467773, 35.015625, 0, 0, 0);
Can somebody help please?
Thank you.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)