Advertisement
jicamacelaru

Untitled

Nov 18th, 2019
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.04 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fun>
  4. #include <engine>
  5. #include <hamsandwich>
  6. #include <fakemeta>
  7.  
  8. new g_Menu;
  9. new bool:g_HasSpeed[ 33 ];
  10.  
  11. new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame;
  12.  
  13. public plugin_init() {
  14. register_plugin("PredatorShop", "0.1", "Ex3cuTioN");
  15.  
  16. g_Menu = register_menuid("Predator Shop");
  17. register_menucmd(g_Menu, 1023, "predatorshop");
  18.  
  19. register_clcmd("say /shop","cmdShop",-1,"<cumperi diverse lucruri>");
  20.  
  21. //register_event( "CurWeapon", "set_speed", "be" );
  22. RegisterHam(Ham_Spawn, "player", "Spawn", 1);
  23. RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Ham_ResetMaxSpeedPost", 1);
  24. }
  25.  
  26. public cmdShop(id) {
  27. new menuBody[512];
  28.  
  29. add(menuBody, 511, "\yPredator.Indungi.Ro Shop\w^n^n");
  30. add(menuBody, 511, "\r1. \wHE+2Flash (1100$)\w^n");
  31. add(menuBody, 511, "\r2. \wMachine Guns (5600$)\w^n");
  32. add(menuBody, 511, "\r3. \wViteza (5500$)\w^n");
  33. add(menuBody, 511, "\r4. \wGravitatie (11000$)\w^n");
  34. add(menuBody, 511, "\r5. \wInvizibilitate (14000$)\w^n");
  35. add(menuBody, 511, "\r6. \w50 HP (9000$)\w^n");
  36. add(menuBody, 511, "\r7. \w50 Armor (1500$)\w^n");
  37. add(menuBody, 511, "\r8. \w3 Kills (5000$)\w^n");
  38. add(menuBody, 511, "\r0. \wExit^n");
  39.  
  40. new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9);
  41. show_menu(id, keys, menuBody, -1, "Predator Shop");
  42. }
  43.  
  44. public predatorshop(id, key) {
  45. switch(key)
  46. {
  47. case 0:
  48. {
  49. new bani,banif;
  50. bani = cs_get_user_money(id);
  51. if(bani < 1100) {
  52. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 1100$");
  53. return PLUGIN_HANDLED;
  54. }
  55.  
  56. banif = bani - 1100;
  57. cs_set_user_money(id,banif);
  58. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai cumparat!team HE!y+!team2Flash!y.",banif);
  59. give_item(id,"weapon_hegrenade")
  60. give_item(id,"weapon_flashbang");
  61. give_item(id,"weapon_flashbang");
  62. }
  63. case 1:
  64. {
  65. new bani,banif;
  66. bani = cs_get_user_money(id);
  67. if(bani < 5600) {
  68. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 5600$");
  69. return PLUGIN_HANDLED;
  70. }
  71.  
  72. banif = bani - 5600;
  73. cs_set_user_money(id,banif);
  74. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai cumparat !teamMachine Guns!y.",banif);
  75. give_item(id,"weapon_m249");
  76. }
  77. case 2:
  78. {
  79. new bani,banif;
  80. bani = cs_get_user_money(id);
  81. if(bani < 5500) {
  82. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 5500$");
  83. return PLUGIN_HANDLED;
  84. }
  85.  
  86. banif = bani - 5500;
  87. cs_set_user_money(id,banif);
  88. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai cumparat !teamViteza!y.",banif);
  89.  
  90. g_HasSpeed[ id ] = true;
  91. }
  92. case 3:
  93. {
  94. new bani,banif;
  95. bani = cs_get_user_money(id);
  96. if(bani < 11000) {
  97. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 11000$");
  98. return PLUGIN_HANDLED;
  99. }
  100.  
  101. banif = bani - 11000;
  102. cs_set_user_money(id,banif);
  103. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai cumparat !teamGravitatie!y.",banif);
  104. set_user_gravity(id,0.4);
  105. }
  106. case 4:
  107. {
  108. new bani,banif;
  109. bani = cs_get_user_money(id);
  110. if(bani < 14000) {
  111. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 14000$");
  112. return PLUGIN_HANDLED;
  113. }
  114.  
  115. banif = bani - 14000;
  116. cs_set_user_money(id,banif);
  117. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai cumparat !teamInvizibilitate!y.",banif);
  118. set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 30);
  119. }
  120. case 5:
  121. {
  122. new bani,banif;
  123. bani = cs_get_user_money(id);
  124. if(bani < 9000) {
  125. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 9000$");
  126. return PLUGIN_HANDLED;
  127. }
  128.  
  129. banif = bani - 9000;
  130. cs_set_user_money(id,banif);
  131. set_user_health ( id, get_user_health ( id ) + 50 );
  132. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai cumparat !team+50 Health!y.",banif);
  133. }
  134. case 6:
  135. {
  136. new bani, banif;
  137. bani = cs_get_user_money(id);
  138. if(bani < 1500) {
  139. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 1500$");
  140. return PLUGIN_HANDLED;
  141. }
  142.  
  143. banif = bani - 1500;
  144. cs_set_user_money(id,banif);
  145. set_user_armor ( id, get_user_armor ( id ) + 50 );
  146. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai cumparat !team+50 Armor!y.",banif);
  147. }
  148. case 7:
  149. {
  150. new bani, banif;
  151. bani = cs_get_user_money(id);
  152. if(bani < 5000) {
  153. chat_color(id,"!g[Predator.Indungi.Ro]!y Ai nevoie de!team 5000$");
  154. return PLUGIN_HANDLED;
  155. }
  156.  
  157. banif = bani - 5000;
  158. cs_set_user_money(id, banif);
  159. set_user_frags(id, get_user_frags(id) + 3);
  160. chat_color(id, "!g[Predator.Indungi.Ro]!y Ai cumparat !team+3 Kills!y.");
  161. }
  162.  
  163. default: return PLUGIN_HANDLED;
  164. }
  165. return PLUGIN_HANDLED;
  166. }
  167.  
  168. public removeInvis(id) {
  169. set_user_noclip(id,0);
  170. }
  171.  
  172. /*public set_speed( id )
  173. {
  174. if ( !g_HasSpeed[ id ] )
  175. return 1;
  176.  
  177. new Float:speed = get_user_maxspeed(id) + 130.0;
  178. set_user_maxspeed(id, speed);
  179.  
  180. return 1;
  181. }*/
  182.  
  183. public Ham_ResetMaxSpeedPost( id ) {
  184.  
  185. if( is_user_alive( id ) && get_user_maxspeed( id ) != 1.0 ) {
  186.  
  187. new Float:flMaxSpeed;
  188.  
  189. if( g_HasSpeed[ id ] ) {
  190. flMaxSpeed = get_user_maxspeed(id) + 130.0;
  191. }
  192.  
  193. if( flMaxSpeed > 0.0 ) {
  194. set_pev( id, pev_maxspeed, flMaxSpeed );
  195. }
  196. }
  197. }
  198.  
  199. public client_connect( id ) g_HasSpeed[ id ] = false;
  200. public client_disconnect( id ) g_HasSpeed[ id ] = false;
  201. public Spawn(id) g_HasSpeed[id] = false;
  202.  
  203. stock chat_color(const id, const input[], any:...)
  204. {
  205. new count = 1, players[32]
  206. static msg[191]
  207. vformat(msg, 190, input, 3)
  208.  
  209. replace_all(msg, 190, "!g", "^4")
  210. replace_all(msg, 190, "!y", "^1")
  211. replace_all(msg, 190, "!team", "^3")
  212.  
  213. if (id) players[0] = id; else get_players(players, count, "ch")
  214. {
  215. for (new i = 0; i < count; i++)
  216. {
  217. if (is_user_connected(players[i]))
  218. {
  219. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  220. write_byte(players[i]);
  221. write_string(msg);
  222. message_end();
  223. }
  224. }
  225. }
  226. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement