Advertisement
Guest User

Illegal Market - Weapon store by AlexzzPro

a guest
Apr 5th, 2011
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. /*
  2. |||||||||||||||||||||||||||||||||||||||||||||||||
  3. ||Weapon Store By AlexzzPro ||
  4. ||Please keep the credits to me ||
  5. ||Contact me on SA-MP Forum for any questions ||
  6. ||www.forum.sa-mp.com/member.php?u=116256 ||
  7. |||||||||||||||||||||||||||||||||||||||||||||||||
  8. */
  9.  
  10. //||--Defines & Includes--||//
  11. #include <a_samp>
  12. #define FILTERSCRIPT
  13. #define COLOR_YELLOW 0xFFFF00AA
  14. //||--Pickups--||//
  15. new iWeapon; // The pickup of the weapon store
  16. //||--Dialogs--||//
  17. #define WEAPON1 1337
  18. #define WEAPON2 1338
  19. #define WEAPON3 1339
  20. #define WEAPON4 1400
  21. #define WEAPON5 1401
  22. #define WEAPON6 1402
  23. #define WEAPON7 1403
  24. //||--Weapon Prices--||//
  25. new deagle = 1000; //Price of the deagle
  26. new shotgun = 4000;//Price of the shotgun
  27. new mp5 = 3000; //Price of the mp5
  28. new m4 = 5000;//Price of the M4
  29. new sniper = 10000;// Price of the Sniper
  30. new spas = 8000;//Price of the Spas12
  31. //||--Weapon Ammos--||//
  32. new deagleammo = 200; // The ammo for deagle
  33. new shotgunammo = 100; // The ammo for shotgun
  34. new mp5ammo = 300; // The ammo for mp5
  35. new m4ammo = 500; // The ammo for M4
  36. new sniperammo = 100; // The ammo for Sniper Rifle
  37. new spasammo = 400; // The ammo for Spas12
  38. #if defined FILTERSCRIPT
  39.  
  40. public OnFilterScriptInit()
  41. {
  42. print("\n--------------------------------------");
  43. print(" Weapon Store By AlexzzPro");
  44. print("--------------------------------------\n");
  45. iWeapon = CreatePickup(1318, 23, 1577.7579, -1474.5370, 14.2209);
  46. return 1;
  47. }
  48.  
  49. public OnFilterScriptExit()
  50. {
  51. return 1;
  52. }
  53. #endif
  54.  
  55. public OnPlayerPickUpPickup(playerid, pickupid)
  56. {
  57. if(pickupid == iWeapon)
  58. {
  59. ShowPlayerDialog(playerid, WEAPON1, DIALOG_STYLE_LIST, "Illegal Market - Weapon Store","Deagle[$1000]\nShotgun[$4000]\nMP5[$3000]\nM4[$5000]\nSniper Rifle[$10.000\nSpas12[$8000]","Buy","Close");
  60. return 1;
  61. }
  62. return 1;
  63. }
  64.  
  65. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  66. {
  67. if(dialogid == WEAPON7)
  68. {
  69. if(response)
  70. {
  71. GivePlayerMoney(playerid, -spas);
  72. GivePlayerWeapon(playerid, 27, spasammo);
  73. SendClientMessage(playerid, COLOR_YELLOW, "You purchased a Spas12 for $8000");
  74. }
  75. if(!response)
  76. {
  77. SendClientMessage(playerid, COLOR_YELLOW, "Alright, Come back when you changed your mind");
  78. }
  79. }
  80. if(dialogid == WEAPON6)
  81. {
  82. if(response)
  83. {
  84. GivePlayerMoney(playerid, -sniper);
  85. GivePlayerWeapon(playerid, 34, sniperammo);
  86. SendClientMessage(playerid, COLOR_YELLOW, "You purchased a Sniper Rifle for $10.000");
  87. }
  88. if(!response)
  89. {
  90. SendClientMessage(playerid, COLOR_YELLOW, "Alright, Come back when you changed your mind");
  91. }
  92. }
  93. if(dialogid == WEAPON5)
  94. {
  95. if(response)
  96. {
  97. GivePlayerMoney(playerid, -m4);
  98. GivePlayerWeapon(playerid, 31, m4ammo);
  99. SendClientMessage(playerid, COLOR_YELLOW, "You purchased a M4 for $5000");
  100. }
  101. if(!response)
  102. {
  103. SendClientMessage(playerid, COLOR_YELLOW, "Alright, Come back when you changed your mind");
  104. }
  105. }
  106. if(dialogid == WEAPON4)
  107. {
  108. if(response)
  109. {
  110. GivePlayerMoney(playerid, -mp5);
  111. GivePlayerWeapon(playerid, 29, mp5ammo);
  112. SendClientMessage(playerid, COLOR_YELLOW, "You purchased a MP5 for $3000");
  113. }
  114. if(!response)
  115. {
  116. SendClientMessage(playerid, COLOR_YELLOW, "Alright, Come back when you changed your mind");
  117. }
  118. }
  119. if(dialogid == WEAPON3)
  120. {
  121. if(response)
  122. {
  123. GivePlayerMoney(playerid, -shotgun);
  124. GivePlayerWeapon(playerid, 25, shotgunammo);
  125. SendClientMessage(playerid, COLOR_YELLOW, "You purchased a shotgun for $4000");
  126. }
  127. if(!response)
  128. {
  129. SendClientMessage(playerid, COLOR_YELLOW, "Alright, Come back when you changed your mind");
  130. }
  131. }
  132. if(dialogid == WEAPON2)
  133. {
  134. if(response)
  135. {
  136. GivePlayerMoney(playerid, -deagle);
  137. GivePlayerWeapon(playerid, 24, deagleammo);
  138. SendClientMessage(playerid, COLOR_YELLOW, "You purchased a deagle for $1000");
  139. }
  140. if(!response)
  141. {
  142. SendClientMessage(playerid, COLOR_YELLOW, "Alright, Come back when you changed your mind");
  143. }
  144. }
  145. if(dialogid == WEAPON1)
  146. {
  147. if(response)
  148. {
  149. if(listitem == 0)
  150. {
  151. if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough money!");
  152. {
  153. ShowPlayerDialog(playerid, WEAPON2, DIALOG_STYLE_MSGBOX, "Deagle","Do you wish to purchase a deagle for {FF0000}$1000","Yes","No");
  154. }
  155. }
  156. if(listitem == 1)
  157. {
  158. if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough money!");
  159. {
  160. ShowPlayerDialog(playerid, WEAPON3, DIALOG_STYLE_MSGBOX, "Shotgun","Do you wish to purchase a shotgun for {FF0000}$4000","Yes","No");
  161. }
  162. }
  163. if(listitem == 2)
  164. {
  165. if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough money!");
  166. {
  167. ShowPlayerDialog(playerid, WEAPON4, DIALOG_STYLE_MSGBOX, "MP5","Do you wish to purchase a MP5 for {FF0000}$3000","Yes","No");
  168.  
  169. }
  170. }
  171. if(listitem == 3)
  172. {
  173. if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough money!");
  174. {
  175. ShowPlayerDialog(playerid, WEAPON5, DIALOG_STYLE_MSGBOX, "M4","Do you wish to purchase a M4 for {FF0000}$5000","Yes","No");
  176. }
  177. }
  178. if(listitem == 4)
  179. {
  180. if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough money!");
  181. {
  182. ShowPlayerDialog(playerid, WEAPON6, DIALOG_STYLE_MSGBOX, "Sniper Rifle","Do you wish to purchase a Sniper Rifle for {FF0000}$100000","Yes","No");
  183. }
  184. }
  185. if(listitem == 5)
  186. {
  187. if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough money!");
  188. {
  189. ShowPlayerDialog(playerid, WEAPON7, DIALOG_STYLE_MSGBOX, "Spas12","Do you wish to purchase a Spas12 for {FF0000}$8000","Yes","No");
  190. }
  191. }
  192. }
  193. }
  194. return 1;
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement