Viggz

WeaponShop Script!

Jun 12th, 2012
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. // -------------This Script Is Made By Viggz!-------------
  2. // Hope You Will Enjoy and having fun with it!:)
  3. // If You See any bugs or have any questions, You are free to ask in Forum-samp!
  4.  
  5. #include <a_samp>
  6.  
  7. public OnPlayerRequestClass(playerid, classid)
  8. {
  9. return 1;
  10. }
  11.  
  12. public OnPlayerConnect(playerid)
  13. {
  14. SendClientMessage(playerid, 0xFF0000FF, "This Server Is Using WeaponShop Scripted By Viggz!");
  15. SendClientMessage(playerid, 0xFF0000FF, "Use /weaponshop too open the Weapon Dialog/Shop");
  16. return 1;
  17. }
  18.  
  19. public OnPlayerDisconnect(playerid, reason)
  20. {
  21. return 1;
  22. }
  23.  
  24. public OnPlayerSpawn(playerid)
  25. {
  26. return 1;
  27. }
  28.  
  29. public OnPlayerDeath(playerid, killerid, reason)
  30. {
  31. return 1;
  32. }
  33.  
  34. public OnVehicleSpawn(vehicleid)
  35. {
  36. return 1;
  37. }
  38.  
  39. public OnVehicleDeath(vehicleid, killerid)
  40. {
  41. return 1;
  42. }
  43.  
  44. public OnPlayerText(playerid, text[])
  45. {
  46. return 1;
  47. }
  48.  
  49. public OnPlayerCommandText(playerid, cmdtext[])
  50. {
  51. if (strcmp("/weaponshop", cmdtext, true, 10) == 0)
  52. {
  53. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Viggz Scripted Weapon Shop!", "{1818F2}---(Weapon Menu!)---\n{FFFFFF}1.Deagle(500$)\n{FFFFFF}2.Dildo(500$)\n{FFFFFF}3.MP5(1000$)\n{FFFFFF}4.M4(1000$)\n{FFFFFF}5.AK-47(1000$)\n{FFFFFF}6.Spraycan(500$)", "Purchase", "Cancel");
  54. return 1;
  55. }
  56. return 0;
  57. }
  58.  
  59. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  60. {
  61. return 1;
  62. }
  63.  
  64. public OnPlayerExitVehicle(playerid, vehicleid)
  65. {
  66. return 1;
  67. }
  68.  
  69. public OnPlayerStateChange(playerid, newstate, oldstate)
  70. {
  71. return 1;
  72. }
  73.  
  74. public OnPlayerEnterCheckpoint(playerid)
  75. {
  76. return 1;
  77. }
  78.  
  79. public OnPlayerLeaveCheckpoint(playerid)
  80. {
  81. return 1;
  82. }
  83.  
  84. public OnPlayerEnterRaceCheckpoint(playerid)
  85. {
  86. return 1;
  87. }
  88.  
  89. public OnPlayerLeaveRaceCheckpoint(playerid)
  90. {
  91. return 1;
  92. }
  93.  
  94. public OnRconCommand(cmd[])
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerRequestSpawn(playerid)
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnObjectMoved(objectid)
  105. {
  106. return 1;
  107. }
  108.  
  109. public OnPlayerObjectMoved(playerid, objectid)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnPlayerPickUpPickup(playerid, pickupid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnVehicleMod(playerid, vehicleid, componentid)
  120. {
  121. return 1;
  122. }
  123.  
  124. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  125. {
  126. return 1;
  127. }
  128.  
  129. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  130. {
  131. return 1;
  132. }
  133.  
  134. public OnPlayerSelectedMenuRow(playerid, row)
  135. {
  136. return 1;
  137. }
  138.  
  139. public OnPlayerExitedMenu(playerid)
  140. {
  141. return 1;
  142. }
  143.  
  144. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  145. {
  146. return 1;
  147. }
  148.  
  149. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  150. {
  151. return 1;
  152. }
  153.  
  154. public OnRconLoginAttempt(ip[], password[], success)
  155. {
  156. return 1;
  157. }
  158.  
  159. public OnPlayerUpdate(playerid)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerStreamIn(playerid, forplayerid)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnPlayerStreamOut(playerid, forplayerid)
  170. {
  171. return 1;
  172. }
  173.  
  174. public OnVehicleStreamIn(vehicleid, forplayerid)
  175. {
  176. return 1;
  177. }
  178.  
  179. public OnVehicleStreamOut(vehicleid, forplayerid)
  180. {
  181. return 1;
  182. }
  183.  
  184. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  185. {
  186. switch(dialogid) // Lookup the dialogid
  187. {
  188. case 1:
  189. {
  190. if(!response)
  191. {
  192. SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
  193. return 1; // We processed it
  194. }
  195.  
  196. switch(listitem) // This is far more efficient than using an if-elseif-else structure
  197. {
  198. case 0: // Listitems start with 0, not 1
  199. {
  200. SendClientMessage(playerid, 0xFF0000FF, "You Can Not Use This Option, Please Choose Another One If Possible!"); // Says that this is not an option!
  201. }
  202. case 1:
  203. {
  204. GivePlayerMoney(playerid, -500); // Will take 500$ from the player!
  205. GivePlayerWeapon(playerid, 24, 250); //Give playerid Deagle with 250 ammo
  206. SendClientMessage(playerid, 0x37FF00FF, "You Have Bought 250 Ammo Of Deagle!"); // Send Message to player
  207. }
  208. case 2:
  209. {
  210. GivePlayerMoney(playerid, -500); // Will take 500$ from the player!
  211. GivePlayerWeapon(playerid, 11, 1); //Give playerid 1 dildo
  212. SendClientMessage(playerid, 0x37FF00FF, "You Have Bought 1 Dildo!"); // Send Message to player
  213. }
  214. case 3:
  215. {
  216. GivePlayerMoney(playerid, -1000); // Will take 1000$ from the player!
  217. GivePlayerWeapon(playerid, 29, 250); // Give playerid MP5 with 250 ammo!
  218. SendClientMessage(playerid, 0x37FF00FF, "You Have Bought 250 Ammo Of MP5!"); // Send Message to player
  219. }
  220. case 4:
  221. {
  222. GivePlayerMoney(playerid, -1000); // Will take 1000$ from the player!
  223. GivePlayerWeapon(playerid, 31, 250); // Give Player 250 Ammo Of M4
  224. SendClientMessage(playerid, 0x37FF00FF, "You Have Bought 250 Ammo Of M4!"); // Send Message to player
  225. }
  226. case 5:
  227. {
  228. GivePlayerMoney(playerid, -1000); // Will take 1000$ from the player!
  229. GivePlayerWeapon(playerid, 30, 250); // Give Player 250 Ammo Of Ak-47
  230. SendClientMessage(playerid, 0x37FF00FF, "You Have Bought 250 Ammo Of AK-47"); // Send Message to player
  231. }
  232. case 6:
  233. {
  234. GivePlayerMoney(playerid, -500); // Will take 500$ from the player!
  235. GivePlayerWeapon(playerid, 41, 100); // Give player 100 Ammo Of Spraycan!
  236. SendClientMessage(playerid, 0x37FF00FF, "You Have Bought 100 Ammo Of SprayCan!"); // Send Message to player
  237. }
  238. // Add the rest of your listitems for dialog 1 here
  239. }
  240.  
  241. }
  242. // Add the rest of your dialogs here
  243.  
  244. }
  245. return 0; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).
  246. }
  247.  
  248. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  249. {
  250. return 1;
  251. }
Advertisement
Add Comment
Please, Sign In to add comment