PHP код:
forward LoadGZ();
public LoadGZ()
{
new fields;
cache_get_data(TOTALGZ, fields);
if(!TOTALGZ) return print("[Загрузка ганг зон] Ошибка: Таблица пуста");
if(TOTALGZ > sizeof(GZInfo)) return printf("[Загрузка ганг зон] Ошибка: Число гангзон в базе данных (%d) больше, чем размер массива GZInfo(%d)", TOTALGZ, sizeof(GZInfo));
new time = GetTickCount();
for(new i = 1; i != sizeof(GZInfo); i++)
{
GZInfo[i][gCoords][0] = cache_get_field_content_float(i, "First_Coordinate", connect_to_mysql);
GZInfo[i][gCoords][1] = cache_get_field_content_float(i, "Second_Coordinate", connect_to_mysql);
GZInfo[i][gCoords][2] = cache_get_field_content_float(i, "Third_Coordinate", connect_to_mysql);
GZInfo[i][gCoords][3] = cache_get_field_content_float(i , "Fourth_Coordinate", connect_to_mysql);
GZInfo[i][gFrak] = cache_get_field_content_int(i-1, "Group", connect_to_mysql);
//printf ("[Debug] ID: %d | [0]: %f | [1]: %f | [2]: %f | [3]: %f", i, GZInfo[i][gCoords][0], GZInfo[i][gCoords][1], GZInfo[i][gCoords][2], GZInfo[i][gCoords][3]);
switch(GZInfo[i][gFrak])
{
case 1: GZGrove++;
case 2: GZBallas++;
case 3: GZRifa++;
case 4: GZAztecas++;
case 5: GZVagos++;
}
GZInfo[i][id] = GangZoneCreate(GZInfo[i][gCoords][0],GZInfo[i][gCoords][1],GZInfo[i][gCoords][2],GZInfo[i][gCoords][3]);
}
return printf(" [Загрузка ганг зон]: Было загружено - %d потрачено %d (ms)", TOTALGZ, GetTickCount() - time);
}
Вот так вот сделал 1 зона куда то теряться..
- - - Добавлено - - -
А вот ещё конвертировать пробувал не получаеться...
PHP код:
format(convert_string,sizeof(convert_string),"Time: %02d:%02d",Convert(vremyadokonca, convert_string));
TextDrawSetString(CaptureTime, convert_string);
PHP код:
stock Convert(seconds, stringTo[], size = sizeof(stringTo))
{
stringTo[0] = 0x0;
new result[4];
result[0] = floatround(seconds / (3600 * 24));
result[1] = floatround(seconds / 3600);
result[2] = floatround((seconds / 60) - (result[1] * 60));
result[3] = floatround(seconds - ((result[1] * 3600) + (result[2] * 60)));
switch(result[0])
{
case 0:
{
switch(result[1])
{
case 0: format(stringTo,size,"%02d:%02d",result[2],result[3]);
default: format(stringTo,size,"%d:%02d:%02d",result[1],result[2],result[3]);
}
}
}
return stringTo;
}