Advertisement
Guest User

shop_dr

a guest
May 15th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fun>
  4. #include <hamsandwich>
  5. #include <colorchat>
  6.  
  7. new pret_awp, pret_hp, pret_ap, pret_scout, pret_fb_he, pret_sg_hp;
  8.  
  9. public plugin_init()
  10. {
  11. register_plugin("Shop DR", "1.1", "StefaN@CSX")
  12. register_clcmd("say /shop", "menu")
  13.  
  14. pret_awp = register_cvar("awp_cost", "5000")
  15. pret_hp = register_cvar("hp_cost", "4500")
  16. pret_ap = register_cvar("ap_cost", "4500")
  17. pret_scout = register_cvar("scout_cost", "3000")
  18. pret_fb_he = register_cvar("fb_he_cost", "3000")
  19. pret_sg_hp = register_cvar("sg_hp_cost", "3500")
  20. }
  21.  
  22. public menu(id)
  23. {
  24. new menu = menu_create("\yDeathRun Shop^n\wAlege ce doresti sa cumperi:", "menu_item", cs_get_user_money(id))
  25.  
  26. menu_additem(menu, "AWP \y(5000$)", "1")
  27. menu_additem(menu, "Scout \y(3000$)", "2")
  28. menu_additem(menu, "Flashbang + HE \y(3000$)", "3")
  29. menu_additem(menu, "Smokegrenade + 25 HP \y(3500$)", "4")
  30. menu_additem(menu, "150 HP \y(4500$)", "5")
  31. menu_additem(menu, "100 AP \y(4500$)", "6")
  32.  
  33. menu_display(id, menu, 0)
  34. return PLUGIN_HANDLED
  35. }
  36.  
  37. public menu_item(id, menu, item, player)
  38. {
  39. if(item == MENU_EXIT)
  40. {
  41. return PLUGIN_HANDLED
  42. }
  43.  
  44. new data[6], iName[64]
  45. new access, callback
  46.  
  47. menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback);
  48.  
  49. new key = str_to_num(data)
  50.  
  51. switch(key)
  52. {
  53. case 1:
  54. {
  55. if(cs_get_user_team(id) & CS_TEAM_CT)
  56. {
  57. if(cs_get_user_money(id) <= get_pcvar_num(pret_awp))
  58. {
  59. ColorChat(id, GREEN, "^3[Shop] ^4Nu ai suficienti bani^1. ^4Ai nevoie de^1: ^4%i$", get_pcvar_num(pret_awp))
  60. }
  61.  
  62. if(cs_get_user_money(id) >= get_pcvar_num(pret_awp))
  63. {
  64. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pret_awp))
  65. give_item(id, "weapon_awp")
  66.  
  67. ColorChat(id, GREEN, "^3[Shop] ^4Ai cumparat ^3AWP^1. ^4Ai ramas cu^1: ^4%i$", cs_get_user_money(id))
  68. }
  69. }
  70. else{
  71. ColorChat(id, GREEN, "^3[Shop] ^4Trebuie sa fii CT ^4pentru a cumpara ^3AWP^1.")
  72. }
  73. }
  74.  
  75. case 2:
  76. {
  77. if(cs_get_user_team(id) & CS_TEAM_CT)
  78. {
  79. if(cs_get_user_money(id) <= get_pcvar_num(pret_scout))
  80. {
  81. ColorChat(id, GREEN, "^3[Shop] ^4Nu ai suficienti bani^1. ^4Ai nevoie de^1: ^4%i$", get_pcvar_num(pret_scout))
  82. }
  83.  
  84. if(cs_get_user_money(id) >= get_pcvar_num(pret_scout))
  85. {
  86. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pret_scout))
  87. give_item(id, "weapon_scout")
  88. ColorChat(id, GREEN, "^3[Shop] ^4Ai cumparat ^3Scout^1. ^4Ai ramas cu^1: ^4%i$", cs_get_user_money(id))
  89. }
  90. }
  91. else{
  92. ColorChat(id, GREEN, "^3[Shop] ^4Trebuie sa fii CT ^4pentru a cumpara ^3Scout^1.")
  93. }
  94. }
  95.  
  96. case 3:
  97. {
  98. if(cs_get_user_money(id) <= get_pcvar_num(pret_fb_he))
  99. {
  100. ColorChat(id, GREEN, "^3[Shop] ^4Nu ai suficienti bani^1. ^4Ai nevoie de^1: ^4%i$", get_pcvar_num(pret_fb_he))
  101. }
  102.  
  103. if(cs_get_user_money(id) >= get_pcvar_num(pret_fb_he))
  104. {
  105. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pret_fb_he))
  106. give_item(id, "weapon_flashbang")
  107. give_item(id, "weapon_hegrenade")
  108. cs_set_user_bpammo (id, CSW_FLASHBANG, 2)
  109. //cs_set_user_bpammo (id, CSW_HEGRENADE, 1)
  110. ColorChat(id, GREEN, "^3[Shop] ^4Ai cumparat ^3Flashbang + HE^1. ^4Ai ramas cu^1: ^4%i$", cs_get_user_money(id))
  111. }
  112. }
  113.  
  114. case 4:
  115. {
  116. if(cs_get_user_money(id) <= get_pcvar_num(pret_sg_hp))
  117. {
  118. ColorChat(id, GREEN, "^3[Shop] ^4Nu ai suficienti bani^1. ^4Ai nevoie de^1: ^4%i$", get_pcvar_num(pret_sg_hp))
  119. }
  120.  
  121. if(cs_get_user_money(id) >= get_pcvar_num(pret_sg_hp))
  122. {
  123. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pret_sg_hp))
  124. set_user_health(id, get_user_health(id) + 25)
  125. give_item(id, "weapon_smokegrenade")
  126. //cs_set_user_bpammo (id, CSW_SMOKEGRENADE, 1)
  127. ColorChat(id, GREEN, "^3[Shop] ^4Ai cumparat ^3Smokegrenade + 25 HP^1. ^4Ai ramas cu^1: ^4%i$", cs_get_user_money(id))
  128. }
  129. }
  130.  
  131. case 5:
  132. {
  133. if(cs_get_user_money(id) <= get_pcvar_num(pret_hp))
  134. {
  135. ColorChat(id, GREEN, "^3[Shop] ^4Nu ai suficienti bani^1. ^4Ai nevoie de^1: ^4%i$", get_pcvar_num(pret_hp))
  136. }
  137.  
  138. if(cs_get_user_money(id) >= get_pcvar_num(pret_hp))
  139. {
  140. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pret_hp))
  141. set_user_health(id, get_user_health(id) + 150)
  142. ColorChat(id, GREEN, "^3[Shop] ^4Ai cumparat ^3 150 HP^1. ^4Ai ramas cu^1: ^4%i$", cs_get_user_money(id))
  143. }
  144. }
  145.  
  146. case 6:
  147. {
  148. if(cs_get_user_money(id) <= get_pcvar_num(pret_ap))
  149. {
  150. ColorChat(id, GREEN, "^3[Shop] ^4Nu ai suficienti bani^1. ^4Ai nevoie de^1: ^4%i$", get_pcvar_num(pret_ap))
  151. }
  152.  
  153. if(cs_get_user_money(id) >= get_pcvar_num(pret_ap))
  154. {
  155. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pret_ap))
  156. set_user_armor(id, get_user_armor(id) + 100)
  157. ColorChat(id, GREEN, "^3[Shop] ^4Ai cumparat ^3 100 AP^1. ^4Ai ramas cu^1: ^4%i$", cs_get_user_money(id))
  158. }
  159. }
  160.  
  161. }
  162.  
  163. return PLUGIN_HANDLED;
  164. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement