25.11.2016, 14:18
PHP Code:
public LoadGangZones()
{
new rows, fields, id = 1, time = GetTickCount();
cache_get_data(rows, fields);
for(new i = 1; i < rows; i++)
{
if(rows)
{
GZInfo[id][gID] = cache_get_field_content_int(i, "id", DATABASE);
GZInfo[id][gCoords][0] = cache_get_field_content_float(i, "ginfo1", DATABASE);
GZInfo[id][gCoords][1] = cache_get_field_content_float(i, "ginfo2", DATABASE);
GZInfo[id][gCoords][2] = cache_get_field_content_float(i, "ginfo3", DATABASE);
GZInfo[id][gCoords][3] = cache_get_field_content_float(i, "ginfo4", DATABASE);
GZInfo[id][gDefenders] = cache_get_field_content_int(i, "fraction", DATABASE);
GZInfo[id][gID] = GangZoneCreate(GZInfo[id][gCoords][0], GZInfo[id][gCoords][1], GZInfo[id][gCoords][2], GZInfo[id][gCoords][3]);
ZoneOnBattle[id] = false;
GZInfo[id][gPlayerAttacker] = 0;
GZInfo[id][gPlayerDefender] = 0;
GZInfo[id][gAttackers] = 0;
GZSafeTime[id] = 0;
TOTALGZ++, id++;
}
else printf("[Ошибка MySQL] Номер гангзоны %i", i);
}
printf("[Загружено ганг зон]: <%i>. Потрачено: <%i мс>.", TOTALGZ, GetTickCount() - time);
return true;
}