04.05.2015, 13:55
Hello!
I'm trying to load an MTA Race map with XML loader. Small maps are loaded without any problem, but one of the advanced DM maps with 5000-7000 objects is taking way too long to load.
Anyone got any clue on how to reduce this lag/time created?
Any answer is appreciated.
This is the part of code that loads the maps:
I'm trying to load an MTA Race map with XML loader. Small maps are loaded without any problem, but one of the advanced DM maps with 5000-7000 objects is taking way too long to load.
Anyone got any clue on how to reduce this lag/time created?
Any answer is appreciated.
This is the part of code that loads the maps:
pawn Код:
for(new i = 1;i <= xml_get_int(file, "count(map/object)");i++)
{
new model, Float:pos[6];
format(string, STRING_LENG, "map/object[%d]/@model", i);
model = xml_get_int(file, string);
format(string, STRING_LENG, "map/object[%d]/@posX", i);
pos[0] = xml_get_float(file, string);
format(string, STRING_LENG, "map/object[%d]/@posY", i);
pos[1] = xml_get_float(file, string);
format(string, STRING_LENG, "map/object[%d]/@posZ", i);
pos[2] = xml_get_float(file, string);
format(string, STRING_LENG, "map/object[%d]/@rotX", i);
pos[3] = xml_get_float(file, string);
format(string, STRING_LENG, "map/object[%d]/@rotY", i);
pos[4] = xml_get_float(file, string);
format(string, STRING_LENG, "map/object[%d]/@rotZ", i);
pos[5] = xml_get_float(file, string);
CreateObject(model, pos[0], pos[1], pos[2], pos[3], pos[4], pos[5],GLOBAL_OBJECTS_DISTANCE);
}