Advertisement
Guest User

Weapon system by stuun23

a guest
Nov 22nd, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <streamer>
  4. //STWeapon sys by stuun V1.2
  5. COMMAND:weaponshop(playerid, params[])
  6. {
  7. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Weapon shop", "{ff0000}Deagle {00CC00}$2000\n{FF0000}Shotgun {00CC00}$1000\n{FF0000}Sniper {00CC00}$3000\n{FF0000}M4 {00CC00}$5000\n{FF0000}MP5 {00CC00}$1000\n{FF0000}Combat {00CC00}$6000\n{FF0000}Grenade {00CC00}$6000\n{FF0000}Tec9 {00CC00}$4000\n{ff0000}Slilenced pistol {00CC00}$1000\n{ff0000}AK-47 {00CC00}$5000", "Purchase", "Exit");
  8. return 1;
  9. }
  10.  
  11. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  12. {
  13. if(response)
  14. {
  15. switch(1)
  16. {
  17. case 1:
  18. {
  19. switch(listitem)
  20. {
  21. case 0:
  22. {
  23. if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  24. GivePlayerMoney(playerid, -2000);
  25. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought deagle.");
  26. GivePlayerWeapon(playerid, 24, 100);
  27. }
  28. case 1:
  29. {
  30. if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  31. GivePlayerMoney(playerid, -1000);
  32. GivePlayerWeapon(playerid, 25, 200);
  33. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought shotgun.");
  34. }
  35. case 2:
  36. {
  37. if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  38. GivePlayerMoney(playerid, -3000);
  39. GivePlayerWeapon(playerid, 34, 200);
  40. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought Sniper");
  41. }
  42. case 3:
  43. {
  44. if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  45. GivePlayerMoney(playerid, -5000);
  46. GivePlayerWeapon(playerid, 31, 200);
  47. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought m4.");
  48. }
  49. case 4:
  50. {
  51. if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  52. GivePlayerMoney(playerid, -1000);
  53. GivePlayerWeapon(playerid, 32, 200);
  54. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought mp5");
  55. }
  56. case 5:
  57. {
  58. if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  59. GivePlayerMoney(playerid, -6000);
  60. GivePlayerWeapon(playerid, 27, 200);
  61. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought shotgun.");
  62. }
  63. case 6:
  64. {
  65. if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  66. GivePlayerMoney(playerid, -6000);
  67. GivePlayerWeapon(playerid, 16, 200);
  68. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought grenade");
  69. }
  70. case 7:
  71. {
  72. if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  73. GivePlayerMoney(playerid, -4000);
  74. GivePlayerWeapon(playerid, 32, 200);
  75. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought tec-9.");
  76. }
  77. case 8:
  78. {
  79. if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  80. GivePlayerMoney(playerid, -1000);
  81. GivePlayerWeapon(playerid, 23, 200);
  82. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought tec-9.slienced pistol");
  83. }
  84. case 9:
  85. {
  86. if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You don't have enough cash.");
  87. GivePlayerMoney(playerid, -5000);
  88. GivePlayerWeapon(playerid, 30, 200);
  89. SendClientMessage(playerid, -1, "{FFCC66}[SHOP] {00CC00}You have bought AK-47");
  90. }
  91. }
  92. }
  93. }
  94. }
  95. return 1;
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement