DeluxeGG

Untitled

Mar 20th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. fpublic HousesLoad() // Коллбэк загрузки
  2. {
  3. new time = GetTickCount();
  4. new klass[2];
  5. new rows,fields;
  6. cache_get_data(rows,fields);
  7. if(rows)
  8. {
  9. for(new idx = 1,ids = 0; idx <= rows; idx++; ids++)
  10. {
  11. //============================= Дробная структура ==============================
  12. house[idx][hEnterX] = cache_get_field_content_float(ids, "EnterX");
  13. house[idx][hEnterY] = cache_get_field_content_float(ids, "EnterY");
  14. house[idx][hEnterZ] = cache_get_field_content_float(ids, "EnterZ");
  15. house[idx][hExitX] = cache_get_field_content_float(ids, "ExitX");
  16. house[idx][hExitY] = cache_get_field_content_float(ids, "ExitY");
  17. house[idx][hExitZ] = cache_get_field_content_float(ids, "ExitZ");
  18. house[idx][hCarX] = cache_get_field_content_float(ids, "CarX");
  19. house[idx][hCarY] = cache_get_field_content_float(ids, "CarY");
  20. house[idx][hCarZ] = cache_get_field_content_float(ids, "CarZ");
  21. house[idx][hCarAngle] = cache_get_field_content_float(ids, "CarAngle");
  22. //============================= Текстовая структура ============================
  23. cache_get_field_content(ids, "Player", house[idx][hPlayer], DATABASE, MAX_PLAYER_NAME);
  24. //============================= Численная структура ============================
  25. house[idx][hID] = cache_get_field_content_int(ids, "ID");
  26. house[idx][hClass] = cache_get_field_content_int(ids, "Class");
  27. house[idx][hCena] = cache_get_field_content_int(ids, "Cena");
  28. house[idx][hDoor] = cache_get_field_content_int(ids, "Door");
  29. house[idx][hInt] = cache_get_field_content_int(ids, "Int");
  30. house[idx][hHouse] = cache_get_field_content_int(ids, "House");
  31. house[idx][hPickup] = cache_get_field_content_int(ids, "Pickup");
  32. house[idx][hIcon] = cache_get_field_content_int(ids, "Icon");
  33. //==============================================================================
  34. if(house[idx][hPlayer] == 0)
  35. {
  36. house[idx][hPickup] = CreatePickup(1273, 23, house[idx][hEnterX], house[idx][hEnterY], house[idx][hEnterZ],-1);
  37. house[idx][hIcon] = CreateDynamicMapIcon(house[idx][hEnterX], house[idx][hEnterY],
  38. house[idx][hEnterZ], 31, COLOR_WHITE, 0, -1, -1, 200.0);
  39. switch(house[idx][hClass])
  40. {
  41. case 0: klass = "N";
  42. case 1: klass = "D";
  43. case 2: klass = "C";
  44. case 3: klass = "B";
  45. case 4: klass = "A";
  46. case 5: klass = "S";
  47. }
  48. }
  49. else
  50. {
  51. house[idx][hPickup] = CreatePickup(1272, 23, house[idx][hEnterX], house[idx][hEnterY], house[idx][hEnterZ],-1);
  52. house[idx][hIcon] = CreateDynamicMapIcon(house[idx][hEnterX],
  53. house[idx][hEnterY], house[idx][hEnterZ], 32, COLOR_WHITE, 0, -1, -1, 200.0);
  54. switch(house[idx][hClass])
  55. {
  56. case 0: klass = "N";
  57. case 1: klass = "D";
  58. case 2: klass = "C";
  59. case 3: klass = "B";
  60. case 4: klass = "A";
  61. case 5: klass = "S";
  62. }
  63. }
  64. TOTALHOUSES++;
  65. }
  66. }
  67. printf("[Загружено домов]: <%i>. Времени затрачено: <%i мс>",TOTALHOUSES,GetTickCount()-time);
  68. return true;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment