21.04.2013, 14:44
Everytime I put this near my stocks in my script it stops to compile (amx turns to 0KBs)
I believe that there's something wrong in the code itself, I tried it on other scripts, it owns a bug, and I know what Im saying, Please help me to discover and solve the bug in it!
pawn Код:
stock LoadObjects()
{
new dinfo[15][128];
new string[256];
new File:file = fopen("objects22.cfg", io_read);
if(file)
{
new idx = 1;
while(idx < MAX_OBJ)
{
fread(file, string);
split(string, dinfo, '|');
ObjInfo[idx][oModel] = strval(dinfo[0]);
ObjInfo[idx][oX] = floatstr(dinfo[1]);
ObjInfo[idx][oY] = floatstr(dinfo[2]);
ObjInfo[idx][oZ] = floatstr(dinfo[3]);
ObjInfo[idx][oRX] = floatstr(dinfo[4]);
ObjInfo[idx][oRY] = floatstr(dinfo[5]);
ObjInfo[idx][oRZ] = floatstr(dinfo[6]);
if(ObjInfo[idx][oModel]) // If gate exists
{
ObjInfo[idx][obj] = CreateDynamicObject(ObjInfo[idx][oModel], ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ], ObjInfo[idx][oRX], ObjInfo[idx][oRY], ObjInfo[idx][oRZ]);
format(string, sizeof(string), "Object ID: %d (Model ID: %d)", idx, ObjInfo[idx][oModel]);
ObjInfo[idx][oText] = CreateDynamic3DTextLabel(string, COLOR_GREY, ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ], 10);
}
idx++;
}
}
print("Objects loaded successfully.");
return 1;
}