Advertisement
Marlborox

Untitled

Jun 8th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.20 KB | None | 0 0
  1. if(dialogid == DIALOG_VEHSPAWNCAR)
  2. {
  3. if(response)
  4. {
  5. if(listitem == 0)
  6. {
  7. new i = SelectedCar[playerid],strings[256];
  8. new speed = MySQLCheckSpeed(PlayerInfo[playerid][pCarModel][i]);
  9. if(PlayerInfo[playerid][pCarBlock][i] > 0) format(strings,sizeof(strings),"Vehicle Model: %d\nDistance Traveled: %.0f KM\nVehicle Age: %d days\nInsurance Price: $%s\nInsurance Points: %d\nTop speed: %d km/h\nBlocked for: %d hours",PlayerInfo[playerid][pCarModel][i],PlayerInfo[playerid][pCarKM][i],GetDaysFromTimestamp(PlayerInfo[playerid][pCarBuyTime][i]),FormatNumber(PlayerInfo[playerid][pCarInsPrice][i]),PlayerInfo[playerid][pCarIns][i],speed,PlayerInfo[playerid][pCarBlock][i]);
  10. else format(strings,sizeof(strings),"Vehicle Model: %d\nDistance Traveled: %.0f KM\nVehicle Age: %d days\nInsurance Price: $%s\nInsurance Points: %d\nTop speed: %d km/h",PlayerInfo[playerid][pCarModel][i],PlayerInfo[playerid][pCarKM][i],GetDaysFromTimestamp(PlayerInfo[playerid][pCarBuyTime][i]),FormatNumber(PlayerInfo[playerid][pCarInsPrice][i]),PlayerInfo[playerid][pCarIns][i],speed);
  11. ShowPlayerDialog(playerid,DIALOG_VEHINFO,DIALOG_STYLE_MSGBOX,"Vehicle Info",strings,"Close","");
  12. }
  13. if(listitem == 1)
  14. {
  15. new i = SelectedCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective;
  16. if(IsTrailerAttachedToVehicle(PlayerInfo[playerid][pCarID][i])) return SendClientMessage(playerid, COLOR_WHITE, "On a mission right now, can't use this command.");
  17. if(!CarTow(PlayerInfo[playerid][pCarID][i]) && PlayerInfo[playerid][pCarID][i] != 0) return SendClientMessage(playerid, COLOR_GREY, "The car is in use and it can't be towed.");
  18. if(PlayerInfo[playerid][pCarID][i] != 0) DestroyVehicle(PlayerInfo[playerid][pCarID][i]);
  19. LoadCar(playerid);
  20. PlayerInfo[playerid][pCarID][i] = CreateVehicle(PlayerInfo[playerid][pCarModel][i],PlayerInfo[playerid][pCarLocX][i],PlayerInfo[playerid][pCarLocY][i],PlayerInfo[playerid][pCarLocZ][i],PlayerInfo[playerid][pCarAngle][i],PlayerInfo[playerid][pCarColor1][i],PlayerInfo[playerid][pCarColor2][i],-1);
  21. SetVehicleNumberPlate(PlayerInfo[playerid][pCarID][i], CarPlate[playerid][i]);
  22. SetVehicleHealth(PlayerInfo[playerid][pCarID][i], PlayerInfo[playerid][pCarHP][i]);
  23. UpdateVehicleDamageStatus(PlayerInfo[playerid][pCarID][i], PlayerInfo[playerid][pCarDamage1][i], PlayerInfo[playerid][pCarDamage2][i], PlayerInfo[playerid][pCarDamage3][i], PlayerInfo[playerid][pCarDamage4][i]);
  24. Gas[PlayerInfo[playerid][pCarID][i]] = PlayerInfo[playerid][pCarGas][i];
  25. if(PlayerInfo[playerid][pCarLock][i] == 0)
  26. {
  27. GetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],engine,lights,alarm,doors,bonnet,boot,objective);
  28. SetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],VEHICLE_PARAMS_OFF,lights,alarm,0,bonnet,boot,objective);
  29. }
  30. else
  31. {
  32. GetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],engine,lights,alarm,doors,bonnet,boot,objective);
  33. SetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],VEHICLE_PARAMS_OFF,lights,alarm,1,bonnet,boot,objective);
  34. }
  35. for(new d; d < 17; d++)
  36. {
  37. if(CarMod[playerid][i][d] != 0) AddVehicleComponent(PlayerInfo[playerid][pCarID][i],CarMod[playerid][i][d]);
  38. }
  39. ChangeVehiclePaintjob(PlayerInfo[playerid][pCarID][i], PlayerInfo[playerid][pCarPaintJ][i]);
  40. vehEngine[PlayerInfo[playerid][pCarID][i]] = 0;
  41. if(strlen(CarVipName[playerid][i]) > 0)
  42. {
  43. SetVipText(playerid, i);
  44. }
  45. SendClientMessage(playerid, COLOR_GREY, "Your car has been respawned.");
  46. }
  47. if(listitem == 2)
  48. {
  49. new i = SelectedCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective;
  50. if(IsTrailerAttachedToVehicle(PlayerInfo[playerid][pCarID][i])) return SendClientMessage(playerid, COLOR_WHITE, "On a mission right now, can't use this command.");
  51. if(!CarTow(PlayerInfo[playerid][pCarID][i]) && PlayerInfo[playerid][pCarID][i] != 0) return SendClientMessage(playerid, COLOR_GREY, "The car is in use and it can't be towed.");
  52. if(PlayerInfo[playerid][pCarID][i] != 0) DestroyVehicle(PlayerInfo[playerid][pCarID][i]);
  53. LoadCar(playerid);
  54. PlayerInfo[playerid][pCarID][i] = CreateVehicle(PlayerInfo[playerid][pCarModel][i],PlayerInfo[playerid][pCarLLocX][i],PlayerInfo[playerid][pCarLLocY][i],PlayerInfo[playerid][pCarLLocZ][i],PlayerInfo[playerid][pCarAngle2][i],PlayerInfo[playerid][pCarColor1][i],PlayerInfo[playerid][pCarColor2][i],-1);
  55. SetVehicleNumberPlate(PlayerInfo[playerid][pCarID][i], CarPlate[playerid][i]);
  56. SetVehicleHealth(PlayerInfo[playerid][pCarID][i], PlayerInfo[playerid][pCarHP][i]);
  57. UpdateVehicleDamageStatus(PlayerInfo[playerid][pCarID][i], PlayerInfo[playerid][pCarDamage1][i], PlayerInfo[playerid][pCarDamage2][i], PlayerInfo[playerid][pCarDamage3][i], PlayerInfo[playerid][pCarDamage4][i]);
  58. Gas[PlayerInfo[playerid][pCarID][i]] = PlayerInfo[playerid][pCarGas][i];
  59. if(PlayerInfo[playerid][pCarLock][i] == 0)
  60. {
  61. GetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],engine,lights,alarm,doors,bonnet,boot,objective);
  62. SetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],VEHICLE_PARAMS_OFF,lights,alarm,0,bonnet,boot,objective);
  63. }
  64. else
  65. {
  66. GetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],engine,lights,alarm,doors,bonnet,boot,objective);
  67. SetVehicleParamsEx(PlayerInfo[playerid][pCarID][i],VEHICLE_PARAMS_OFF,lights,alarm,1,bonnet,boot,objective);
  68. }
  69. for(new d; d < 17; d++)
  70. {
  71. if(CarMod[playerid][i][d] != 0) AddVehicleComponent(PlayerInfo[playerid][pCarID][i],CarMod[playerid][i][d]);
  72. }
  73. ChangeVehiclePaintjob(PlayerInfo[playerid][pCarID][i], PlayerInfo[playerid][pCarPaintJ][i]);
  74. vehEngine[PlayerInfo[playerid][pCarID][i]] = 0;
  75. if(strlen(CarVipName[playerid][i]) > 0)
  76. {
  77. SetVipText(playerid, i);
  78. }
  79. SendClientMessage(playerid, COLOR_GREY, "Your car has been respawned.");
  80. }
  81. if(listitem == 3)
  82. {
  83. new i = SelectedCar[playerid];
  84. if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_WHITE, "{FFF8C6}On a mission right now, can't use this command.");
  85. if(BusinessRob[playerid] > 0) return SendClientMessage(playerid,COLOR_WHITE,"You can't use this while robbing the bank.");
  86. if(CP[playerid] < 1 && !IsATruck(GetPlayerVehicleID(playerid)) && CheckBus[playerid] < 1 && GotoMats[playerid] < 1)
  87. {
  88. if(PlayerInfo[playerid][pCarID][i] != 0)
  89. {
  90. LocateCar(PlayerInfo[playerid][pCarID][i],playerid);
  91. }
  92. else return SendClientMessage(playerid, COLOR_WHITE, "This vehicle is not spawned.");
  93. }
  94. else
  95. {
  96. ShowPlayerDialog(playerid, DIALOG_JOBULETES, DIALOG_STYLE_MSGBOX, "Anulare Checkpoint", "Esti sigur ca vrei sa anulezi checkpoint-ul curent?", "Da", "Nu");
  97. }
  98. }
  99. if(listitem == 4)
  100. {
  101. new i = SelectedCar[playerid];
  102. new inscarpricee = PlayerInfo[playerid][pCarInsPrice][i],stringul[200];
  103. if(PlayerInfo[playerid][pCarIns][i] < 5)
  104. {
  105. if(GetPlayerCash(playerid) >= inscarpricee)
  106. {
  107. format(stringul,sizeof(stringul),"You want to buy 1 insurance for $%d?",inscarpricee);
  108. ShowPlayerDialog(playerid, DIALOG_INSURANCEBUY, DIALOG_STYLE_MSGBOX, "Insurance", stringul, "Yes", "No");
  109. }
  110. }
  111. else
  112. {
  113. ShowPlayerDialog(playerid, DIALOG_INSURANCEBUY2, DIALOG_STYLE_MSGBOX, "Insurance", "You can't have more than 5 insurance", "OK", "");
  114. }
  115. }
  116. if(listitem == 5)
  117. {
  118. if(PlayerInfo[playerid][pPremiumPoints] <= 19) return ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Not enough points", "You don't have enough premium points to do this.", "Close", "");
  119. ShowPlayerDialog(playerid, DIALOG_BUYCLEARKM2, DIALOG_STYLE_MSGBOX, "Clear KM & Days", "Do you want to pay 20 premium points to clear your car km and days?","Yes","No");
  120. }
  121. if(listitem == 6)
  122. {
  123. if(PlayerInfo[playerid][pPremiumPoints] <= 99) return ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Not enough points", "You don't have enough premium points.\nNu ai suficiente puncte premium.", "Ok", "");
  124. new idcar = SelectedCar[playerid];
  125. if(PlayerInfo[playerid][pCarVIP][idcar] == 1) return SS(playerid, COLOR_LIGHTGREEN3, "Acest vehicul este deja VIP.", "This vehicle is already VIP.");
  126. if(PlayerInfo[playerid][pCarModel][idcar] != 411 && PlayerInfo[playerid][pCarModel][idcar] != 541 && PlayerInfo[playerid][pCarModel][idcar] != 560) return SS(playerid, COLOR_LIGHTGREEN3, "Momentan doar vehiculele Infernus, Bullet si Sultan pot fi upgradate.", "This option can only be used for Infernus, Bullet and Sultan vehicles.");
  127. ShowPlayerDialog(playerid, DIALOG_BUYVIPCAR, DIALOG_STYLE_MSGBOX, "VIP Vehicle", "Do you want to pay 100 premium points to make this vehicle VIP?","Yes","No");
  128. }
  129. if(listitem == 7)
  130. {
  131. new i = SelectedCar[playerid];
  132. if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_WHITE, "{FFF8C6}On a mission right now, can't use this command.");
  133. if(BusinessRob[playerid] > 0) return SendClientMessage(playerid,COLOR_WHITE,"You can't use this while robbing the bank.");
  134. if(CP[playerid] < 1 && !IsATruck(GetPlayerVehicleID(playerid)) && CheckBus[playerid] < 1 && GotoMats[playerid] < 1)
  135. {
  136. if(PlayerInfo[playerid][pCarID][i] != 0)
  137. {
  138. if(PlayerInfo[playerid][pLanguage] == 1) ShowPlayerDialog(playerid, DIALOG_UNSTUCK, DIALOG_STYLE_MSGBOX, "Unstuck car", "This option was created for those who can't find the car using /findcar.\nUsing this option your car will be spawned in a parking lot in LV.\n\nAre you sure you want to do this?", "Yes", "No");
  139. else if(PlayerInfo[playerid][pLanguage] == 2) ShowPlayerDialog(playerid, DIALOG_UNSTUCK, DIALOG_STYLE_MSGBOX, "Unstuck car", "Aceasta optiune a fost creata pentru cei care nu-si pot gasi masina folosind /findcar.\nFolosind aceasta optiune vei avea masina spawnata intr-o parcare din LV.\n\nEsti sigur ca vrei sa faci asta?", "Da", "Nu");
  140. }
  141. else return SendClientMessage(playerid, COLOR_WHITE, "This vehicle is not spawned.");
  142. }
  143. else
  144. {
  145. ShowPlayerDialog(playerid, DIALOG_JOBULETES, DIALOG_STYLE_MSGBOX, "Anulare Checkpoint", "Esti sigur ca vrei sa anulezi checkpoint-ul curent?", "Da", "Nu");
  146. }
  147. }
  148. }
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement