Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. function LoadCars(id)
  2. {
  3. new temp = cache_num_rows();
  4. if(temp == 0)
  5. {
  6. CarInfo[id][cID] = -2;
  7. }
  8. else
  9. {
  10. CarInfo[id][cID] = cache_get_field_content_int(0, "ID");
  11. CarInfo[id][cModel] = cache_get_field_content_int(0, "Model");
  12. CarInfo[id][cLocationx] = cache_get_field_content_float(0, "Locationx");
  13. CarInfo[id][cLocationy] = cache_get_field_content_float(0, "Locationy");
  14. CarInfo[id][cLocationz] = cache_get_field_content_float(0, "Locationz");
  15. CarInfo[id][cAngle] = cache_get_field_content_float(0, "Angle");
  16. CarInfo[id][cColorOne] = cache_get_field_content_int(0, "ColorOne");
  17. CarInfo[id][cColorTwo] = cache_get_field_content_int(0, "ColorTwo");
  18. cache_get_field_content(0, "Owner", CarInfo[id][cOwner], SQL, 129);
  19. CarInfo[id][cValue] = cache_get_field_content_int(0, "Value");
  20. cache_get_field_content(0, "License", CarInfo[id][cLicense], SQL, 129);
  21. CarInfo[id][cAlarm] = cache_get_field_content_int(0, "Alarm");
  22. CarInfo[id][cLock] = cache_get_field_content_int(0, "Lockk");
  23. CarInfo[id][mod0] = cache_get_field_content_int(0, "mod0");
  24. CarInfo[id][mod1] = cache_get_field_content_int(0, "mod1");
  25. CarInfo[id][mod2] = cache_get_field_content_int(0, "mod2");
  26. CarInfo[id][mod3] = cache_get_field_content_int(0, "mod3");
  27. CarInfo[id][mod4] = cache_get_field_content_int(0, "mod4");
  28. CarInfo[id][mod5] = cache_get_field_content_int(0, "mod5");
  29. CarInfo[id][mod6] = cache_get_field_content_int(0, "mod6");
  30. CarInfo[id][mod7] = cache_get_field_content_int(0, "mod7");
  31. CarInfo[id][mod8] = cache_get_field_content_int(0, "mod8");
  32. CarInfo[id][mod9] = cache_get_field_content_int(0, "mod9");
  33. CarInfo[id][mod10] = cache_get_field_content_int(0, "mod10");
  34. CarInfo[id][mod11] = cache_get_field_content_int(0, "mod11");
  35. CarInfo[id][mod12] = cache_get_field_content_int(0, "mod12");
  36. CarInfo[id][mod13] = cache_get_field_content_int(0, "mod13");
  37. CarInfo[id][paintjob] = cache_get_field_content_int(0, "paintjob");
  38. CarInfo[id][KM] = cache_get_field_content_float(0, "KM");
  39. CarInfo[id][Userid] = cache_get_field_content_int(0, "Userid");
  40. CarInfo[id][Confiscated] = cache_get_field_content_int(0, "Confiscated");
  41. //CarInfo[id][Spawned] = cache_get_field_content_int(0, "Spawned");
  42. CarInfo[id][cSpecial] = cache_get_field_content_int(0, "Special");
  43. }
  44. }
  45.  
  46. function PreLoadCars()
  47. {
  48. new query[128];
  49. new x = cache_get_field_content_int(0, "MAX(ID)");
  50. pvehs = x;
  51. for(new i = 1; i <= x; i++)
  52. {
  53. mysql_format(SQL, query, sizeof(query), "SELECT * FROM `cars` WHERE ID = %d",i);
  54. mysql_tquery(SQL, query, "LoadCars", "i", i);
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement