Advertisement
Guest User

Untitled

a guest
Jul 6th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.66 KB | None | 0 0
  1. public LoadCar(playerid)
  2. {
  3. for(new idd; idd < MAX_PERSONAL_VEHICLES; idd++)
  4. {
  5. PlayerInfo[playerid][pCarModel][idd] = 0;
  6. PlayerInfo[playerid][pCarLocX][idd] = 0.0;
  7. PlayerInfo[playerid][pCarLocY][idd] = 0.0;
  8. PlayerInfo[playerid][pCarLocZ][idd] = 0.0;
  9. PlayerInfo[playerid][pCarAngle][idd] = 0.0;
  10. PlayerInfo[playerid][pCarLLocX][idd] = 0.0;
  11. PlayerInfo[playerid][pCarLLocY][idd] = 0.0;
  12. PlayerInfo[playerid][pCarLLocZ][idd] = 0.0;
  13. PlayerInfo[playerid][pCarAngle2][idd] = 0.0;
  14. PlayerInfo[playerid][pCarBuyTime][idd] = 0;
  15. PlayerInfo[playerid][pCarColor1][idd] = 1;
  16. PlayerInfo[playerid][pCarColor2][idd] = 1;
  17. PlayerInfo[playerid][pCarLock][idd] = 0;
  18. PlayerInfo[playerid][pCarInsPrice][idd] = 0;
  19. PlayerInfo[playerid][pCarIns][idd] = 0;
  20. PlayerInfo[playerid][pCarKM][idd] = 0.0;
  21. PlayerInfo[playerid][pCarKMLast][idd] = 0;
  22. PlayerInfo[playerid][pCarVIP][idd] = 0;
  23. PlayerInfo[playerid][pCarNeon][idd] = 0;
  24. PlayerInfo[playerid][pCarVipColors][idd] = 0;
  25. PlayerInfo[playerid][pCarHP][idd] = 0.0;
  26. PlayerInfo[playerid][pCarDamage1][idd] = 0;
  27. PlayerInfo[playerid][pCarDamage2][idd] = 0;
  28. PlayerInfo[playerid][pCarDamage3][idd] = 0;
  29. PlayerInfo[playerid][pCarDamage4][idd] = 0;
  30. PlayerInfo[playerid][pCarGas][idd] = 100;
  31. PlayerInfo[playerid][pCarPaintJ][idd] = 6;
  32. PlayerInfo[playerid][pCarBlock][idd] = 0;
  33. PlayerInfo[playerid][pCarEvent][idd] = 0;
  34. PlayerInfo[playerid][pCarVipXPos][idd] = 0.0;
  35. PlayerInfo[playerid][pCarVipYPos][idd] = 0.0;
  36. PlayerInfo[playerid][pCarVipZPos][idd] = 0.0;
  37. PlayerInfo[playerid][pCarVipRXPos][idd] = 0.0;
  38. PlayerInfo[playerid][pCarVipRYPos][idd] = 0.0;
  39. PlayerInfo[playerid][pCarVipRZPos][idd] = 0.0;
  40. CarVipName[playerid][idd] = "";
  41. CarPlate[playerid][idd] = "";
  42. CarOwner[playerid][idd] = "";
  43. for(new s; s < 17; s++)
  44. {
  45. CarMod[playerid][idd][s] = 0;
  46. }
  47. }
  48. new query[256],string[20];
  49. for(new idd; idd < MAX_PERSONAL_VEHICLES; idd++)
  50. {
  51. format(query, sizeof(query), "SELECT * FROM `cars` WHERE `ID`='%d'", PlayerInfo[playerid][pCar][idd]);
  52. new Cache: result = mysql_query(SQL, query);
  53. if(cache_get_row_count() > 0)
  54. {
  55. PlayerInfo[playerid][pCarModel][idd] = cache_get_field_content_int(0, "Model");
  56. PlayerInfo[playerid][pCarLocX][idd] = cache_get_field_content_float(0, "Locationx");
  57. PlayerInfo[playerid][pCarLocY][idd] = cache_get_field_content_float(0, "Locationy");
  58. PlayerInfo[playerid][pCarLocZ][idd] = cache_get_field_content_float(0, "Locationz");
  59. PlayerInfo[playerid][pCarAngle][idd] = cache_get_field_content_float(0, "Angle");
  60. PlayerInfo[playerid][pCarLLocX][idd] = cache_get_field_content_float(0, "Locationx2");
  61. PlayerInfo[playerid][pCarLLocY][idd] = cache_get_field_content_float(0, "Locationy2");
  62. PlayerInfo[playerid][pCarLLocZ][idd] = cache_get_field_content_float(0, "Locationz2");
  63. PlayerInfo[playerid][pCarAngle2][idd] = cache_get_field_content_float(0, "Angle2");
  64. PlayerInfo[playerid][pCarBuyTime][idd] = cache_get_field_content_int(0, "BuyTime");
  65. PlayerInfo[playerid][pCarColor1][idd] = cache_get_field_content_int(0, "ColorOne");
  66. PlayerInfo[playerid][pCarColor2][idd] = cache_get_field_content_int(0, "ColorTwo");
  67. PlayerInfo[playerid][pCarLock][idd] = cache_get_field_content_int(0, "Lockk");
  68. PlayerInfo[playerid][pCarInsPrice][idd] = cache_get_field_content_int(0, "Inscarprice");
  69. PlayerInfo[playerid][pCarIns][idd] = cache_get_field_content_int(0, "Insurancecar");
  70. PlayerInfo[playerid][pCarKM][idd] = cache_get_field_content_float(0, "KM");
  71. PlayerInfo[playerid][pCarKMLast][idd] = cache_get_field_content_int(0, "LastKM");
  72. PlayerInfo[playerid][pCarVIP][idd] = cache_get_field_content_int(0, "VIP");
  73. PlayerInfo[playerid][pCarNeon][idd] = cache_get_field_content_int(0, "Neon");
  74. PlayerInfo[playerid][pCarVipColors][idd] = cache_get_field_content_int(0, "VipColors");
  75. PlayerInfo[playerid][pCarHP][idd] = cache_get_field_content_float(0, "HP");
  76. PlayerInfo[playerid][pCarDamage1][idd] = cache_get_field_content_int(0, "Damage1");
  77. PlayerInfo[playerid][pCarDamage2][idd] = cache_get_field_content_int(0, "Damage2");
  78. PlayerInfo[playerid][pCarDamage3][idd] = cache_get_field_content_int(0, "Damage3");
  79. PlayerInfo[playerid][pCarDamage4][idd] = cache_get_field_content_int(0, "Damage4");
  80. PlayerInfo[playerid][pCarGas][idd] = cache_get_field_content_int(0, "Gas");
  81. PlayerInfo[playerid][pCarPaintJ][idd] = cache_get_field_content_int(0, "PaintJ");
  82. PlayerInfo[playerid][pCarBlock][idd] = cache_get_field_content_int(0, "Block");
  83. PlayerInfo[playerid][pCarEvent][idd] = cache_get_field_content_int(0, "Event");
  84.  
  85. PlayerInfo[playerid][pCarVipXPos][idd] = cache_get_field_content_float(0, "VipXPos");
  86. PlayerInfo[playerid][pCarVipYPos][idd] = cache_get_field_content_float(0, "VipYPos");
  87. PlayerInfo[playerid][pCarVipZPos][idd] = cache_get_field_content_float(0, "VipZPos");
  88. PlayerInfo[playerid][pCarVipRXPos][idd] = cache_get_field_content_float(0, "VipRXPos");
  89. PlayerInfo[playerid][pCarVipRYPos][idd] = cache_get_field_content_float(0, "VipRYPos");
  90. PlayerInfo[playerid][pCarVipRZPos][idd] = cache_get_field_content_float(0, "VipRZPos");
  91.  
  92. cache_get_field_content(0, "VipText", CarVipName[playerid][idd]);
  93. cache_get_field_content(0, "License", CarPlate[playerid][idd], SQL, 30);
  94. cache_get_field_content(0, "Owner", CarOwner[playerid][idd], SQL, 50);
  95. for(new s=1; s <= 17; s++)
  96. {
  97. format(string,sizeof(string),"mod%d",s);
  98. new ids = s-1;
  99. CarMod[playerid][idd][ids] = cache_get_field_content_int(0, string);
  100. }
  101. }
  102. cache_delete(result);
  103. }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement