Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fpublic HousesLoad() // Коллбэк загрузки
- {
- new time = GetTickCount();
- new klass[2];
- new rows,fields;
- cache_get_data(rows,fields);
- if(rows)
- {
- for(new idx = 1,ids = 0; idx <= rows; idx++; ids++)
- {
- //============================= Дробная структура ==============================
- house[idx][hEnterX] = cache_get_field_content_float(ids, "EnterX");
- house[idx][hEnterY] = cache_get_field_content_float(ids, "EnterY");
- house[idx][hEnterZ] = cache_get_field_content_float(ids, "EnterZ");
- house[idx][hExitX] = cache_get_field_content_float(ids, "ExitX");
- house[idx][hExitY] = cache_get_field_content_float(ids, "ExitY");
- house[idx][hExitZ] = cache_get_field_content_float(ids, "ExitZ");
- house[idx][hCarX] = cache_get_field_content_float(ids, "CarX");
- house[idx][hCarY] = cache_get_field_content_float(ids, "CarY");
- house[idx][hCarZ] = cache_get_field_content_float(ids, "CarZ");
- house[idx][hCarAngle] = cache_get_field_content_float(ids, "CarAngle");
- //============================= Текстовая структура ============================
- cache_get_field_content(ids, "Player", house[idx][hPlayer], DATABASE, MAX_PLAYER_NAME);
- //============================= Численная структура ============================
- house[idx][hID] = cache_get_field_content_int(ids, "ID");
- house[idx][hClass] = cache_get_field_content_int(ids, "Class");
- house[idx][hCena] = cache_get_field_content_int(ids, "Cena");
- house[idx][hDoor] = cache_get_field_content_int(ids, "Door");
- house[idx][hInt] = cache_get_field_content_int(ids, "Int");
- house[idx][hHouse] = cache_get_field_content_int(ids, "House");
- house[idx][hPickup] = cache_get_field_content_int(ids, "Pickup");
- house[idx][hIcon] = cache_get_field_content_int(ids, "Icon");
- //==============================================================================
- if(house[idx][hPlayer] == 0)
- {
- house[idx][hPickup] = CreatePickup(1273, 23, house[idx][hEnterX], house[idx][hEnterY], house[idx][hEnterZ],-1);
- house[idx][hIcon] = CreateDynamicMapIcon(house[idx][hEnterX], house[idx][hEnterY],
- house[idx][hEnterZ], 31, COLOR_WHITE, 0, -1, -1, 200.0);
- switch(house[idx][hClass])
- {
- case 0: klass = "N";
- case 1: klass = "D";
- case 2: klass = "C";
- case 3: klass = "B";
- case 4: klass = "A";
- case 5: klass = "S";
- }
- }
- else
- {
- house[idx][hPickup] = CreatePickup(1272, 23, house[idx][hEnterX], house[idx][hEnterY], house[idx][hEnterZ],-1);
- house[idx][hIcon] = CreateDynamicMapIcon(house[idx][hEnterX],
- house[idx][hEnterY], house[idx][hEnterZ], 32, COLOR_WHITE, 0, -1, -1, 200.0);
- switch(house[idx][hClass])
- {
- case 0: klass = "N";
- case 1: klass = "D";
- case 2: klass = "C";
- case 3: klass = "B";
- case 4: klass = "A";
- case 5: klass = "S";
- }
- }
- TOTALHOUSES++;
- }
- }
- printf("[Загружено домов]: <%i>. Времени затрачено: <%i мс>",TOTALHOUSES,GetTickCount()-time);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment