OK, I got problem with this y_ini based loading function wich acts weird.. and it doesnt work at all.
So I need help with this. What I can do that this following LoadAllJails() function fills all those celInfo arrays, because now when I am calling those arrays they are all 0.000000....
pawn Код:
#define MAX_JAILS 5 // Max jails
enum cellInfo
{
jalid,
jobject,
Float:cX,
Float:cY,
Float:cZ,
jairange,
Float:dooropenX,
Float:dooropenY,
Float:dooropenZ,
Float:doorcloseX,
Float:doorcloseY,
Float:doorcloseZ,
jailarea[65],
jailint,
jailobj
};
new celInfo[MAX_JAILS][cellInfo],loaded_jails = 0;
forward LoadCells(jailid, name[], value[]);
----
ongamemodeinit
LoadAllJails();
----
//----------------------------------------------------------
public LoadCells(jailid, name[], value[])
{
print("PARSING START");
INI_Int("jalid",celInfo[jailid][jalid]);
print("JALID");
INI_Int("jobject",celInfo[jailid][jobject]);
INI_Float("cX",celInfo[jailid][cX]);
INI_Float("cY",celInfo[jailid][cY]);
INI_Float("cZ",celInfo[jailid][cZ]);
INI_Int("jairange",celInfo[jailid][jairange]);
INI_Float("dooropenX",celInfo[jailid][dooropenX]);
INI_Float("dooropenY",celInfo[jailid][dooropenY]);
print("DOORY");
INI_Float("dooropenZ",celInfo[jailid][dooropenZ]);
INI_Float("doorcloseX",celInfo[jailid][doorcloseX]);
INI_Float("doorcloseY",celInfo[jailid][doorcloseY]);
INI_Float("doorcloseZ",celInfo[jailid][doorcloseZ]);
INI_String("jailarea",celInfo[jailid][jailarea],128);
print("JAIL AREA");
INI_Int("jailint",celInfo[jailid][jailint]);
new formaatti[225];
format(formaatti,sizeof(formaatti),"X %f Y %f Z %f ID %i", celInfo[jailid][cX],celInfo[jailid][cY], celInfo[jailid][cZ], celInfo[jailid][jalid]);
printf(formaatti);
print("PARSING END");
return 1;
}
//----------------------------------------------------------
stock LoadAllJails()
{
print("LOAD JAIL INTILIAIZE OK");
for(new jailid = 0; jailid < MAX_JAILS; jailid++)
{
print("LOOP START");
format(pfile, sizeof(pfile), "%s/%s/%s/%i%s", CORE_FOLDER, SETTING_FOLDER, SUB_SETTING_JAILS, jailid, CORE_FOLDERS_FILESYSTEM);
print("PFILE OK");
if(fexist(pfile))
{
print("PFILE FOUND");
INI_ParseFile(pfile,"LoadCells",.bExtra = true,.extra = jailid);
print("PARSING OK");
celInfo[jailid][jailobj] = CreateDynamicObject(celInfo[jailid][jobject], celInfo[jailid][doorcloseX], celInfo[jailid][doorcloseY], celInfo[jailid][doorcloseZ], 0.0, 0.0, 0.0);
print("OBJECT CREATE OK");
loaded_jails++;
print("JAIL ADDED OK");
}
}
}
As you guys can see that I have set couple debug prints all over function. Check this log if it helps: