Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.57 KB | None | 0 0
  1. else if(strcmp(x_nr,"buy",true) == 0)
  2. {
  3. new car = 1;
  4. new model = GetVehicleModel(idcar);
  5. if(IsASalesVehicle(idcar))
  6. {
  7. if(PlayerInfo[playerid][pLevel] < 2)
  8. {
  9. SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");
  10. return 1;
  11. }
  12. if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999) { }
  13. else return SendClientMessage(playerid, COLOR_GREY,"* You already own Two cars!");
  14. if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
  15. {
  16. if(PlayerInfo[playerid][pCarLic] == 1)
  17. {
  18. for(new h = 1; h < sizeof(CarInfo); h++)
  19. {
  20. if(CarInfo[h][cOwned] == 1)
  21. {
  22. car = h + 1;
  23. }
  24. }
  25. format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
  26. dini_Create(string);
  27.  
  28. if(PlayerInfo[playerid][pPcarkey] != 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
  29. else { PlayerInfo[playerid][pPcarkey] = car; }
  30. CarInfo[car][cOwned] = 1;
  31. strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
  32. SafeGivePlayerMoney(playerid,-GetVehiclePrice(idcar));
  33. if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
  34. {
  35. CarInfo[car][cLocationx] = 1432.6451;
  36. CarInfo[car][cLocationy] = 1378.7216;
  37. CarInfo[car][cLocationz] = 11.5507;
  38. CarInfo[car][cAngle] = 359.2072;
  39. SendClientMessage(playerid, COLOR_YELLOW2, "Your Aircraft has been deliveried to Las Venturas Airport, you can get it there!");
  40. SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
  41. SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
  42. GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~Las Venturas Airport!", 5000, 3);
  43. }
  44. else if(IsModelABoat(idcar))
  45. {
  46. CarInfo[car][cLocationx] = -1568.9614;
  47. CarInfo[car][cLocationy] = 169.0118;
  48. CarInfo[car][cLocationz] = -0.6016;
  49. CarInfo[car][cAngle] = 208.7506;
  50. SendClientMessage(playerid, COLOR_YELLOW2, "Your Boat has been deliveried to San Fierro Docks, you can get it there!");
  51. SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
  52. SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
  53. GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
  54. }
  55. else
  56. {
  57. CarInfo[car][cLocationx] = 2011.3337;
  58. CarInfo[car][cLocationy] = -2213.2820;
  59. CarInfo[car][cLocationz] = 13.310;
  60. CarInfo[car][cAngle] = 317.1649;
  61. SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle has been deliveried to the Los Santos Airport, you can get it there!");
  62. SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
  63. SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
  64. GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~Los Santos Airport!", 5000, 3);
  65. }
  66. CarInfo[car][cModel] = model;
  67. CarInfo[car][cVirWorld] = 0;
  68. CarInfo[car][cPaintjob] = 999;
  69.  
  70. CarInfo[car][cColorOne] = 1;
  71. CarInfo[car][cColorTwo] = 1;
  72.  
  73. CarInfo[car][cComponent0] = 0;
  74. CarInfo[car][cComponent1] = 0;
  75. CarInfo[car][cComponent2] = 0;
  76. CarInfo[car][cComponent3] = 0;
  77. CarInfo[car][cComponent4] = 0;
  78. CarInfo[car][cComponent5] = 0;
  79. CarInfo[car][cComponent6] = 0;
  80. CarInfo[car][cComponent7] = 0;
  81. CarInfo[car][cComponent8] = 0;
  82. CarInfo[car][cComponent9] = 0;
  83. CarInfo[car][cComponent10] = 0;
  84. CarInfo[car][cComponent11] = 0;
  85. CarInfo[car][cComponent12] = 0;
  86. CarInfo[car][cComponent13] = 0;
  87.  
  88. DestroyVehicle(car);
  89. ownedcar[car] = CreateVehicle(CarInfo[car][cModel],CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],90.0,1,1,30000);
  90. PlayerPlayMusic(playerid);
  91. SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
  92. SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclehelp to view the vehicle manual!");
  93. gEngine[playerid] = 0;
  94. engineOn[GetPlayerVehicleID(playerid)] = false;
  95. SendClientMessage(playerid, COLOR_GREY, "Remember to set the new Security Code of the Car!");
  96. new pass[24];
  97. format(pass, sizeof(pass),"%d%d%d",random(9),random(9),random(9));
  98. CarInfo[car][cCode] = strval(pass);
  99. OnPropUpdate(4,car);
  100. OnPlayerUpdateEx(playerid);
  101. }
  102. else
  103. {
  104. SendClientMessage(playerid, COLOR_WHITE, "* For security reasons, a Driving License is needed to buy a car!");
  105. return 1;
  106. }
  107. }
  108. else
  109. {
  110. SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
  111. return 1;
  112. }
  113. }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement