Guest User

Buyable Weapons By San1

a guest
Jul 31st, 2012
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1.  
  2. #define FILTERSCRIPT
  3.  
  4. #include <a_samp>
  5. #include <zcmd>
  6.  
  7. #define COLOR_GRAD2 0xBFC0C2FF
  8. #define COLOR_GRAD4 0xD8D8D8FF
  9. #define COLOR_RED 0xAA3333AA
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print(" Ammu-Nation Buyable Made By Adrian Myrick");
  17. print("--------------------------------------\n");
  18. return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23. return 1;
  24. }
  25.  
  26. IsAtAmmu(playerid)
  27. {
  28. if(IsPlayerConnected(playerid))
  29. {
  30. if(IsPlayerInRangeOfPoint(playerid, 50.0, 2539, -133.7294, 999.6016))
  31. {
  32. return 1;
  33. }
  34. else if(IsPlayerInRangeOfPoint(playerid, 50.0, 295.1320, -38.5151, 1001.5156))
  35. {
  36. return 1;
  37. }
  38. else if(IsPlayerInRangeOfPoint(playerid, 50.0, 296.919982, -108.071998, 1001.515625))
  39. {
  40. return 1;
  41. }
  42. }
  43. return 0;
  44. }
  45.  
  46. CMD:buygun(playerid, params[])
  47. {
  48. if(!IsAtAmmu(playerid))
  49. {
  50. SendClientMessage(playerid, COLOR_GRAD2, " You are not in a Ammunation Shop");
  51. return 1;
  52. }
  53. else
  54. {
  55. ShowPlayerDialog(playerid, 30001, DIALOG_STYLE_LIST, "Ammunation Shop", "Shotgun (5000)\nMp5 (20000)\nDeagle (35000)\nM4 (75000)\nFullVest (3000)", "Buy", "Cancel");
  56. }
  57. return 1;
  58. }
  59.  
  60. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  61. {
  62. new string[2000];
  63. if(dialogid == 30001)
  64. {
  65. if(response)
  66. {
  67. if(listitem == 0)
  68. {
  69. if (GetPlayerMoney(playerid) >= 5000)
  70. {
  71. GivePlayerMoney(playerid, -5000);
  72. GivePlayerWeapon(playerid, 25, 60000);
  73. format(string, sizeof(string), "Pumped Shotgun Purchase.");
  74. SendClientMessage(playerid, COLOR_RED, string);
  75. }
  76. else
  77. {
  78. SendClientMessage(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
  79. }
  80. }
  81. if(listitem == 1)
  82. {
  83. if (GetPlayerMoney(playerid) >= 20000)
  84. {
  85. GivePlayerMoney(playerid, -20000);
  86. GivePlayerWeapon(playerid, 29, 60000);
  87. format(string, sizeof(string), "Mp5 Purchase");
  88. SendClientMessage(playerid, COLOR_RED, string);
  89. }
  90. else
  91. {
  92. SendClientMessage(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
  93. }
  94. }
  95. if(listitem == 2)
  96. {
  97. if (GetPlayerMoney(playerid) >= 35000)
  98. {
  99. GivePlayerMoney(playerid, -35000);
  100. GivePlayerWeapon(playerid, 24, 60000);
  101. format(string, sizeof(string), "Deagle Purchase");
  102. SendClientMessage(playerid, COLOR_RED, string);
  103. }
  104. else
  105. {
  106. SendClientMessage(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
  107. }
  108. }
  109. if(listitem == 3)
  110. {
  111. if (GetPlayerMoney(playerid) >= 75000)
  112. {
  113. GivePlayerMoney(playerid, -75000);
  114. GivePlayerWeapon(playerid, 31, 60000);
  115. format(string, sizeof(string), "M4 Purchase");
  116. SendClientMessage(playerid, COLOR_RED, string);
  117. }
  118. else
  119. {
  120. SendClientMessage(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
  121. }
  122.  
  123. }
  124. if(listitem == 4)
  125. {
  126. if (GetPlayerMoney(playerid) >= 3000)
  127. {
  128. GivePlayerMoney(playerid, -3000);
  129. SetPlayerArmour(playerid, 100);
  130. format(string, sizeof(string), "KevlarVest Purchase");
  131. SendClientMessage(playerid, COLOR_RED, string);
  132. }
  133. else
  134. {
  135. SendClientMessage(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
  136. }
  137. }
  138. }
  139. }
  140. return 1;
  141. }
  142. #endif
Advertisement
Add Comment
Please, Sign In to add comment