Guest User

Untitled

a guest
Apr 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5.  
  6. #define PLUGIN "New Plug-In"
  7. #define VERSION "1.0"
  8. #define AUTHOR "Måns"
  9.  
  10. const MaxClients = 32;
  11.  
  12. enum _:TNades
  13. {
  14. _He_Grenade,
  15. _Flashbang,
  16. _Smoke_Grenade,
  17. };
  18.  
  19. enum _:CTNades
  20. {
  21. _He_Grenade_Immunity,
  22. _Flashbang_Immunity,
  23. _Smoke_Grenade_Immunity,
  24. };
  25.  
  26. enum _:TModifiers
  27. {
  28. _Health,
  29. _Armor,
  30. _Reincarnation,
  31. _Fall_Damage_Reducer,
  32. };
  33.  
  34. enum _:CTModifiers
  35. {
  36. _Health,
  37. _Armor,
  38. _Reincarnation,
  39. _Fall_Damage_Reducer,
  40. };
  41.  
  42. enum _:ItemData
  43. {
  44. _Name[ MaxClients ],
  45. _Description[ 128 ],
  46. _Category[ MaxClients ],
  47. _Value_Type[ 10 ],
  48. _First_Cost,
  49. _Max_Level,
  50. _Max_Value
  51. };
  52.  
  53. new const TNadeInfo[ TNades ][ ItemData ] =
  54. {
  55. // _He_Grenade
  56. {
  57. "HE Grenade",
  58. "Grants one additional HE",
  59. "TGrenades",
  60. "%",
  61. 10,
  62. 5,
  63. 50
  64. },
  65. // _Flashbang
  66. {
  67. "Flashbang",
  68. "Grants one additional Flash",
  69. "TGrenades",
  70. "%",
  71. 5,
  72. 10,
  73. 100
  74. },
  75. // _Smoke_Grenade
  76. {
  77. "Smoke Grenade",
  78. "Grants one additional Smoke",
  79. "TGrenades",
  80. "%",
  81. 5,
  82. 10,
  83. 100
  84. }
  85. };
  86.  
  87. new const CTNadeInfo[ CTNades ][ ItemData ] =
  88. {
  89. // _He_Grenade_Immunity
  90. {
  91. "HE Grenade Immunity",
  92. "Grants one additional HE Immunity",
  93. "CTGrenades",
  94. "%",
  95. 20,
  96. 5,
  97. 50
  98. },
  99. // _Flashbang_Immunity
  100. {
  101. "Flashbang Immunity",
  102. "Grants one additional Flash Immunity",
  103. "CTGrenades",
  104. "%",
  105. 10,
  106. 10,
  107. 100
  108. },
  109. // _Smoke_Grenade_Immunity
  110. {
  111. "Smoke Grenade",
  112. "Grants one additional Smoke Immunity",
  113. "CTGrenades",
  114. "%",
  115. 10,
  116. 10,
  117. 100
  118. }
  119. };
  120.  
  121. new const TNadeClassname[ TNades ][ ] =
  122. {
  123. "weapon_hegrenade",
  124. "weapon_flashbang",
  125. "weapon_smokegrenade"
  126. };
  127.  
  128. new const CTNadeClassname[ CTNades ][ ] =
  129. {
  130. "",
  131. "",
  132. ""
  133. };
  134.  
  135. new const TPlayerModifiersInfo[ TModifiers ][ ItemData ] =
  136. {
  137. // _Health
  138. {
  139. "Health",
  140. "Increases your base HP",
  141. "T Player Modifiers",
  142. " HP",
  143. 20,
  144. 5,
  145. 50
  146. },
  147. // _Armor
  148. {
  149. "Armor",
  150. "Increases your base AP",
  151. "T Player Modifiers",
  152. " AP",
  153. 10,
  154. 10,
  155. 200
  156. },
  157. // _Reincarnation
  158. {
  159. "Reincarnation",
  160. "Allows you to respawn upon death",
  161. "T Player Modifiers",
  162. "%",
  163. 25,
  164. 5,
  165. 25
  166. },
  167. // _Fall_Damage_Reducer
  168. {
  169. "Fall Damage Reducer",
  170. "Will reduce damage taken from falling",
  171. "T Player Modifiers",
  172. "%",
  173. 10,
  174. 4,
  175. 20
  176. }
  177. };
  178.  
  179. new const CTPlayerModifiersInfo[ CTModifiers ][ ItemData ] =
  180. {
  181. // _Health
  182. {
  183. "Health",
  184. "Increases your base HP",
  185. "CT Player Modifiers",
  186. " HP",
  187. 20,
  188. 5,
  189. 50
  190. },
  191. // _Armor
  192. {
  193. "Armor",
  194. "Increases your base AP",
  195. "CT Player Modifiers",
  196. " AP",
  197. 10,
  198. 10,
  199. 200
  200. },
  201. // _Reincarnation
  202. {
  203. "Reincarnation",
  204. "Allows you to respawn upon death",
  205. "T Player Modifiers",
  206. "%",
  207. 30,
  208. 5,
  209. 50
  210. },
  211. // _Fall_Damage_Reducer
  212. {
  213. "Fall Damage Reducer",
  214. "Will reduce damage taken from falling",
  215. "CT Player Modifiers",
  216. "%",
  217. 10,
  218. 4,
  219. 20
  220. }
  221. };
  222.  
  223. enum Category
  224. {
  225. _T_Grenades,
  226. _CT_Grenades,
  227.  
  228. _T_Player_Modifiers,
  229. _CT_Player_Modifiers,
  230.  
  231. _None
  232. };
  233.  
  234. new gRed[ MaxClients + 1 ],
  235. gBlue[ MaxClients + 1 ]
  236.  
  237. new TNadeLevel[ MaxClients + 1 ][ TNades ],
  238. CTNadeLevel[ MaxClients + 1][ CTNades ],
  239. TPlayerModifierLevel[ MaxClients + 1 ][ TModifiers ],
  240. CTPlayerModifierLevel[ MaxClients + 1 ][ CTModifiers ];
  241.  
  242. new MenuItem[ MaxClients + 1 ],
  243. Category:MenuCategory[ MaxClients + 1 ];
  244.  
  245. new bool:PlayerRevived[ MaxClients + 1 ];
  246.  
  247. new MaxPlayers;
  248.  
  249. public plugin_init() {
  250. register_plugin(PLUGIN, VERSION, AUTHOR)
  251.  
  252. register_clcmd( "say /points", "Points_ShowMainMenu" )
  253. }
  254.  
  255. public Points_ShowMainMenu( const id )
  256. {
  257. if( is_user_connected( id ) )
  258. {
  259. ShowMainMenu( id )
  260. }
  261. }
  262.  
  263. ShowMainMenu( id )
  264. {
  265. new Title[ 256 ];
  266. formatex( Title, charsmax( Title ),
  267. "\r[ \yRedBlue \r]^n\wMain Menu^n^nRed: \y%i^n\wBlue: \y%i^n\wPremium: \y%s\w^n^n",
  268. gRed[ id ],
  269. gBlue[ id ]
  270. )
  271.  
  272. new Menu = menu_create( Title, "MainMenuHandler" ),
  273. Callback = menu_makecallback( "CallbackMainMenu" );
  274.  
  275. menu_additem( Menu, "Terrorist Shop", "1" )
  276. menu_additem( Menu, "Counter-Terrorist Shop", "2" )
  277.  
  278. menu_display( id, Menu );
  279. }
  280.  
  281. public MainMenuHandler( id, Menu, Item )
  282. {
  283. if( Item == MENU_EXIT )
  284. {
  285. menu_destroy( Menu );
  286.  
  287. return;
  288. }
  289.  
  290. new Info[ 2 ], Access, Callback;
  291. menu_item_getinfo( Menu, Item, Access, Info, charsmax( Info ), _, _, Callback );
  292. menu_destroy( Menu );
  293.  
  294. switch( Info[ 0 ] )
  295. {
  296. case '1':
  297. {
  298. ShowTItemCategoryMenu( id );
  299. }
  300. case '2':
  301. {
  302. //ShowCTItemCategoryMenu( id )
  303. }
  304. }
  305. }
  306.  
  307. ShowTItemCategoryMenu( const id )
  308. {
  309. new Title[ 256 ];
  310. formatex( Title, charsmax( Title ),
  311. "\r[ \yRedBlue \r]^n\wTerrorist Item Category Menu^n^n"
  312. );
  313.  
  314. new Menu = menu_create( Title, "ItemTCategoryMenuHandler" );
  315.  
  316. menu_additem( Menu, "Grenades", "1" );
  317. menu_additem( Menu, "Player Modifiers^n", "2" );
  318.  
  319. //menu_additem( Menu, "Item Info", "3" );
  320.  
  321. menu_setprop( Menu, MPROP_EXITNAME, "Main Menu" );
  322.  
  323. menu_display( id, Menu );
  324. }
  325.  
  326. public ItemTCategoryMenuHandler( id, Menu, Item )
  327. {
  328. if( Item == MENU_EXIT )
  329. {
  330. menu_destroy( Menu );
  331.  
  332. ShowMainMenu( id );
  333.  
  334. return;
  335. }
  336.  
  337. new Info[ 2 ], Access, Callback;
  338. menu_item_getinfo( Menu, Item, Access, Info, charsmax( Info ), _, _, Callback );
  339. menu_destroy( Menu );
  340.  
  341. switch( Info[ 0 ] )
  342. {
  343. case '1':
  344. {
  345. //ShowTGrenadeMenu( id );
  346. }
  347. case '2':
  348. {
  349. //ShowTPlayerModifiersMenu( id );
  350. }
  351. case '3':
  352. {
  353. //ShowInfoMOTD( Client );
  354. }
  355. }
  356. }
Add Comment
Please, Sign In to add comment