Advertisement
Guest User

Untitled

a guest
Apr 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. CMD:park(playerid, params[]) {
  2. new car = GetPlayerVehicleID(playerid);
  3. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Nu esti in vehiculul tau.");
  4. if(GetVehicles(playerid) == 0) return SendClientMessage(playerid, COLOR_GREY, "Nu ai un vehicul personal!");
  5. if(PersonalCar(playerid) == -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu esti in unul dintre vehiculele tale personale!");
  6. if(GetPlayerState(playerid) != 2) return SCM(playerid, COLOR_LGREEN, "* Trebuie sa fii la volan pentru a putea folosi aceasta comanda!");
  7. new idd = PersonalCar(playerid);
  8. new Float: vhp;
  9. GetVehicleHealth(car, vhp);
  10. if(vhp < 800) return SendClientMessage(playerid, COLOR_GREY, "Nu poti parca masina cand are sub 800 'viata'!");
  11. if(PlayerToPoint(150.0, playerid, 1716.9065,-1902.4526,13.5661)) return SCM(playerid, -1, "Nu poti parca o masina in jurul spawn-ului.");
  12. new Float:x, Float:y, Float:z, Float:a;
  13. CheckVehicle(CarInfo[idd][Spawned]);
  14. saveTuning(playerid, CarInfo[idd][Spawned]);
  15. GetVehiclePos(car, x, y, z);
  16. GetVehicleZAngle(car, a);
  17.  
  18. CarInfo[idd][cVirtual] = 0;
  19. if(GetPVarInt(playerid, "inGarage") != 0) {
  20. if(garage_slot(playerid, 0) == -1) x = 481.85, y = -405.426, z = 2758.0046;
  21. else if(garage_slot(playerid, 1) == -1) x = 481.85, y = -410.9, z = 2758.0046;
  22. else if(garage_slot(playerid, 2) == -1) x = 481.85, y = -416.301, z = 2758.0046;
  23. else if(garage_slot(playerid, 3) == -1) x = 481.85, y = -421.104, z = 2758.0046;
  24. else if(garage_slot(playerid, 4) == -1) x = 481.85, y = -425.924, z = 2758.0046;
  25. else if(garage_slot(playerid, 5) == -1) x = 493.998, y = -405.426, z = 2758.0046;
  26. else if(garage_slot(playerid, 6) == -1) x = 493.998, y = -410.9, z = 2758.0046;
  27. else if(garage_slot(playerid, 7) == -1) x = 493.998, y = -416.301, z = 2758.0046;
  28. else if(garage_slot(playerid, 8) == -1) x = 493.998, y = -421.104, z = 2758.0046;
  29. else if(garage_slot(playerid, 9) == -1) x = 493.998, y = -425.924, z = 2758.0046;
  30. if(x == 481.85) a = -131.1600;
  31. if(x == 493.998) a = 131.1600;
  32.  
  33. CarInfo[idd][cVirtual] = GetPVarInt(playerid, "inGarage");
  34. SCM(playerid, COLOR_GRAD3, "Your vehicle was parked in the garage.");
  35. }
  36.  
  37. CarInfo[idd][cLocationx] = x;
  38. CarInfo[idd][cLocationy] = y;
  39. CarInfo[idd][cLocationz] = z;
  40.  
  41.  
  42. CarInfo[idd][cAngle] = a;
  43. VehicleOwned[CarInfo[idd][Spawned]] = 0;
  44. VehicleSQL[CarInfo[idd][Spawned]] = 0;
  45.  
  46. DestroyVehicle(car);
  47.  
  48. if(CarInfo[idd][cNeon] != 0) {
  49. DestroyDynamicObject(neon[0][CarInfo[idd][Spawned]]);
  50. DestroyDynamicObject(neon[1][CarInfo[idd][Spawned]]);
  51. neon[0][CarInfo[idd][Spawned]] = 0;
  52. neon[1][CarInfo[idd][Spawned]] = 0;
  53. }
  54. if(strlen(CarInfo[idd][cText]) >= 3) {
  55. DestroyDynamicObject(nameobject[CarInfo[idd][Spawned]]);
  56. }
  57. CarInfo[idd][Spawned] = CreateVehicleEx(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],CarInfo[idd][cColorOne],CarInfo[idd][cColorTwo],-1);
  58. SetVehicleVirtualWorld(CarInfo[idd][Spawned], CarInfo[idd][cVirtual]);
  59. VehicleOwned[CarInfo[idd][Spawned]] = CarInfo[idd][Spawned];
  60. VehicleSQL[CarInfo[idd][Spawned]] = idd;
  61. if(CarInfo[idd][cNeon] != 0) {
  62. new h = CarInfo[idd][Spawned];
  63. if(CarInfo[idd][cNeon] == 1)
  64. {
  65. neon[0][h] = CreateDynamicObject(18648,0,0,0,0,0,0);
  66. neon[1][h] = CreateDynamicObject(18648,0,0,0,0,0,0);
  67. }
  68. else if(CarInfo[idd][cNeon] == 2)
  69. {
  70. neon[0][h] = CreateDynamicObject(18649,0,0,0,0,0,0);
  71. neon[1][h] = CreateDynamicObject(18649,0,0,0,0,0,0);
  72. }
  73. else if(CarInfo[idd][cNeon] == 3)
  74. {
  75. neon[0][h] = CreateDynamicObject(18650,0,0,0,0,0,0);
  76. neon[1][h] = CreateDynamicObject(18650,0,0,0,0,0,0);
  77. }
  78. else if(CarInfo[idd][cNeon] == 4)
  79. {
  80. neon[0][h] = CreateDynamicObject(18652,0,0,0,0,0,0);
  81. neon[1][h] = CreateDynamicObject(18652,0,0,0,0,0,0);
  82. }
  83. else if(CarInfo[idd][cNeon] == 5)
  84. {
  85. neon[0][h] = CreateDynamicObject(18651,0,0,0,0,0,0);
  86. neon[1][h] = CreateDynamicObject(18651,0,0,0,0,0,0);
  87. }
  88. else if(CarInfo[idd][cNeon] == 6)
  89. {
  90. neon[0][h] = CreateDynamicObject(18647,0,0,0,0,0,0);
  91. neon[1][h] = CreateDynamicObject(18647,0,0,0,0,0,0);
  92. }
  93. AttachDynamicObjectToVehicle(neon[0][h], h, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
  94. AttachDynamicObjectToVehicle(neon[1][h], h, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
  95. }
  96. attach_vip_text(idd);
  97.  
  98. SetTunning(idd);
  99. SetVehicleNumberPlate(CarInfo[idd][Spawned], CarInfo[idd][cLicense]);
  100. saveCar(idd);
  101. new Float: Pos[3];
  102. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  103. CarInfo[idd][cLastPos][0] = Pos[0];
  104. CarInfo[idd][cLastPos][1] = Pos[1];
  105. CarInfo[idd][cLastPos][2] = Pos[2];
  106. return 1;
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement