Advertisement
Guest User

xmas

a guest
Nov 19th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.38 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < amxmisc >
  3. #include < cstrike >
  4. #include < fun >
  5. #include < hamsandwich >
  6.  
  7. new const PLUGIN [ ] = "[XMAS FURIOUS]";
  8. new const OWNER_CONTACT [ ] = "Steam:i'm back";
  9. new const OUR_FORUM [ ] = "www.furious.ro";
  10.  
  11. new g_bPoints [ 33 ];
  12.  
  13. new bool: ZU [33 ], bool: KISS [ 33 ], bool: DIZZ [ 33 ];
  14.  
  15. native csdm_get_user_points ( id );
  16. native csdm_set_user_points ( id, iNum );
  17.  
  18. new const g_access_file [ ] = "addons/amxmodx/configs/users.ini";
  19. new const g_password_field [ ] = "_pw";
  20. new const g_admin_flags [ ] = "abcdefghijk"; // flagurile pe care le cumpara
  21.  
  22.  
  23. public plugin_init ( )
  24. {
  25. register_plugin ( "XMAS Game Menu", "1.0", "LondoN #" );
  26.  
  27. register_clcmd ( "chooseteam", "game_menu" );
  28. register_clcmd ( "say /stop", "cmd_stop" );
  29.  
  30. set_task ( 42.5, "TaskAnnounce", _, _, _, "b" );
  31. }
  32.  
  33. public game_menu ( id ) {
  34. new menu = menu_create ( "rXMAS.RANGFORT.RO yGame Menu", "menu_principal" );
  35.  
  36. menu_additem ( menu, "r[1] wContact Owner", "1", 0 );
  37. menu_additem ( menu, "r[2] wRadio Menu", "2", 0 );
  38. menu_additem ( menu, "r[3] wPoints Shop", "3", 0 );
  39. menu_additem ( menu, "r[4] wJoin Spectators", "4", 0 );
  40. menu_additem ( menu, "r[5] wForum", "5", 0 );
  41.  
  42. menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
  43. menu_display ( id, menu, 0 );
  44. return PLUGIN_CONTINUE;
  45. }
  46.  
  47. public menu_principal ( id, menu, item ) {
  48. if ( item == MENU_EXIT ) {
  49. menu_destroy ( menu );
  50. ColorChat ( id, "!x04%s !x03You closed the !x04Game Menu", PLUGIN );
  51. return PLUGIN_HANDLED;
  52. }
  53.  
  54. new szData [ 7 ], szName [ 64 ];
  55. new Access, Callback;
  56.  
  57. menu_item_getinfo ( menu, item, Access, szData, 5, szName, 63, Callback );
  58.  
  59. new szKey = str_to_num ( szData );
  60. g_bPoints [ id ] = csdm_get_user_points ( id );
  61.  
  62. switch ( szKey ) {
  63. case 1 : {
  64. ColorChat ( id, "!x03Contact Detinator: !x04%s", OWNER_CONTACT );
  65. return PLUGIN_CONTINUE;
  66. }
  67. case 2 : {
  68. new g_menu = menu_create ( "rRadio wMenu", "menu_radio" );
  69.  
  70. menu_additem ( g_menu, "r[1] wRadio DIZZ", "1", 0 );
  71. menu_additem ( g_menu, "r[2] wRadio KISS", "2", 0 );
  72. menu_additem ( g_menu, "r[3] wRadio ZU", "3", 0 );
  73.  
  74. menu_setprop ( g_menu, MPROP_EXIT, MEXIT_ALL );
  75. menu_display ( id, g_menu, 0 );
  76. return PLUGIN_CONTINUE;
  77. }
  78. case 3 : {
  79. new title [ 256 ];
  80. formatex ( title, charsmax ( title ), "r Points Shop ^nwPoints: r%d", g_bPoints );
  81.  
  82. new l_menu = menu_create ( title, "menu_points" );
  83.  
  84. menu_additem ( l_menu, "r[1] wBuy Respawn [r50 Pointsw]", "1", 0 );
  85. menu_additem ( l_menu, "r[2] wBuy Trider [r150 Pointsw]", "2", 0 );
  86. menu_additem ( l_menu, "r[3] wBuy Money [r250 Pointsw]", "3", 0 );
  87. menu_additem ( l_menu, "r[4] w75 Frags [r550 Pointsw]", "4", 0 );
  88. menu_additem ( l_menu, "r[5] wBuy SLOT [r1500 Pointsw]", "5", 0 );
  89. menu_additem ( l_menu, "r[6] wBuy ADMIN [r9500 Pointsw]", "6", 0 );
  90.  
  91. menu_setprop ( l_menu, MPROP_EXIT, MEXIT_ALL );
  92. menu_display ( id, l_menu, 0 );
  93. return PLUGIN_CONTINUE;
  94. }
  95. case 4 : {
  96. if ( is_user_alive ( id ) ) {
  97. ColorChat ( id, "!x04%s !x03We can't put you to spectators because you're alive.", PLUGIN );
  98. return PLUGIN_HANDLED;
  99. }
  100.  
  101. if ( is_user_admin ( id ) )
  102. {
  103. cs_set_user_team ( id, CS_TEAM_SPECTATOR );
  104. ColorChat ( id, "!x04%s !x03We moved you to the !x04Spectators", PLUGIN );
  105. }
  106.  
  107. if ( !is_user_alive ( id ) )
  108. {
  109. cs_set_user_team ( id, CS_TEAM_SPECTATOR );
  110. ColorChat ( id, "!x04%s !x03We moved you to the !x04Spectators", PLUGIN );
  111. }
  112. }
  113.  
  114. case 5 : {
  115. ColorChat ( 0, "!x03Forumul este: !x04%s", OUR_FORUM );
  116. }
  117. }
  118.  
  119. return PLUGIN_CONTINUE;
  120. }
  121.  
  122. public menu_radio ( id, g_menu, item ) {
  123. if ( item == MENU_EXIT ) {
  124. menu_destroy ( g_menu );
  125. ColorChat ( id, "!x04%s !x03You closed !x04Radio Menu", PLUGIN );
  126. return PLUGIN_HANDLED;
  127. }
  128.  
  129. new szData [ 7 ], szName [ 64 ];
  130. new Access, Callback;
  131.  
  132. menu_item_getinfo ( g_menu, item, Access, szData, 5, szName, 63, Callback );
  133.  
  134. new szKey = str_to_num ( szData );
  135.  
  136. switch ( szKey ) {
  137. case 1 : {
  138. show_motd ( id, "addons/amxmodx/configs/xmas/radio/dizz.html" );
  139. DIZZ [ id ] = true;
  140. }
  141. case 2 : {
  142. show_motd ( id, "addons/amxmodx/configs/xmas/radio/kiss.html" );
  143. KISS [ id ] = true;
  144. }
  145. case 3 : {
  146. show_motd ( id, "addons/amxmodx/configs/xmas/radio/zu.html" );
  147. ZU [ id ] = true;
  148. }
  149. }
  150.  
  151. return PLUGIN_CONTINUE;
  152. }
  153.  
  154. public menu_points ( id, l_menu, item ) {
  155. if ( item == MENU_EXIT ) {
  156. menu_destroy ( l_menu );
  157. ColorChat ( id, "!x04%s !x03You closed !x04Points Shop", PLUGIN );
  158. return PLUGIN_HANDLED;
  159. }
  160.  
  161. g_bPoints [ id ] = csdm_get_user_points ( id );
  162.  
  163. new szData [ 7 ], szName [ 64 ];
  164. new Access, Callback;
  165.  
  166. menu_item_getinfo ( l_menu, item, Access, szData, 5, szName, 63, Callback );
  167.  
  168. new szKey = str_to_num ( szData );
  169.  
  170. switch ( szKey ) {
  171. case 1 : {
  172. if ( g_bPoints [ id ] < 50 )
  173. {
  174. ColorChat ( id, "!x04%s !x03You need !x0450 !x03points to buy !x04RESPAWN", PLUGIN );
  175. ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
  176. return PLUGIN_HANDLED;
  177. }
  178.  
  179. if ( is_user_alive ( id ) ) {
  180. ColorChat ( id, "!x04%s !x03You are !x04alive", PLUGIN );
  181. return PLUGIN_HANDLED;
  182. }
  183.  
  184. ExecuteHamB ( Ham_CS_RoundRespawn, id );
  185.  
  186. csdm_set_user_points ( id, g_bPoints [ id ] - 50 );
  187. ColorChat ( id, "!x04%s !x03You bought !x04RESPAWN", PLUGIN );
  188. }
  189. case 2 : {
  190. if ( g_bPoints [ id ] < 150 )
  191. {
  192. ColorChat ( id, "!x04%s !x03You need !x04150 !x03points to buy !x04TRYDER", PLUGIN );
  193. ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
  194. return PLUGIN_HANDLED;
  195. }
  196.  
  197. /* Strip Weapons */
  198. strip_user_weapons ( id );
  199.  
  200. /* Giving Weapons */
  201. give_item ( id, "weapon_knife" );
  202. give_item ( id, "weapon_deagle" );
  203. give_item ( id, "weapon_ak47" );
  204. give_item ( id, "weapon_m4a1" );
  205. give_item ( id, "weapon_hegrenade" );
  206. give_item ( id, "weapon_flashbang" );
  207. give_item ( id, "weapon_flashbang" );
  208. give_item ( id, "weapon_smokegrenade" );
  209.  
  210. /* Setting Player HP/AP */
  211. set_user_armor ( id, 100 );
  212. set_user_health ( id, 150 );
  213.  
  214. /* Setting Weapon Ammo */
  215. cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );
  216. cs_set_user_bpammo ( id, CSW_AK47, 90 );
  217. cs_set_user_bpammo ( id, CSW_M4A1, 90 );
  218.  
  219. csdm_set_user_points ( id, g_bPoints [ id ] - 150 );
  220. ColorChat ( id, "!x04%s !x03You bought !x04TRYDER", PLUGIN );
  221. }
  222. case 3 : {
  223. if ( g_bPoints [ id ] < 250 )
  224. {
  225. ColorChat ( id, "!x04%s !x03You need !x04250 !x03points to buy !x04Money (16000)", PLUGIN );
  226. ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
  227. return PLUGIN_HANDLED;
  228. }
  229.  
  230. if ( !is_user_alive ( id ) )
  231. {
  232. ColorChat ( id, "!x04%s !x03You're not !x04alive", PLUGIN );
  233. return PLUGIN_HANDLED;
  234. }
  235.  
  236. if ( cs_get_user_money ( id ) == 16000 )
  237. {
  238. ColorChat ( id, "!x04%s !x03You already have !x0416000 $", PLUGIN );
  239. return PLUGIN_HANDLED;
  240. }
  241.  
  242. cs_set_user_money ( id, 16000 );
  243. csdm_set_user_points ( id, g_bPoints [ id ] - 250 );
  244. ColorChat ( id, "!x04%s !x03You bought !x04Money", PLUGIN );
  245. }
  246. case 4 : {
  247. if ( g_bPoints [ id ] < 550 )
  248. {
  249. ColorChat ( id, "!x04%s !x03You need !x04550 !x03points to buy !x0475 Frags", PLUGIN );
  250. ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
  251. return PLUGIN_HANDLED;
  252. }
  253.  
  254. set_user_frags ( id, get_user_frags ( id ) + 75 );
  255. csdm_set_user_points ( id, g_bPoints [ id ] - 550 );
  256. ColorChat ( id, "!x04%s !x03You bought !x0475 Frags", PLUGIN );
  257. }
  258. case 5 : {
  259. if ( g_bPoints [ id ] < 1500 )
  260. {
  261. ColorChat ( id, "!x04%s !x03You need !x041500 !x03points to buy !x04SLOT", PLUGIN );
  262. ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
  263. return PLUGIN_HANDLED;
  264. }
  265.  
  266. if ( get_user_flags ( id ) & read_flags ( "b" ) )
  267. {
  268. ColorChat ( id, "!x04%s !x03You already have !x04SLOT", PLUGIN );
  269. return PLUGIN_HANDLED;
  270. }
  271.  
  272. new szPassword [ 3 ], szBuffer [ 512 ], szName [ 32 ];
  273.  
  274. formatex ( szPassword, charsmax ( szPassword ), "%c%c%c", random_num ( 'A', 'Z' ), random_num ( 'a', 'z' ), random_num ( '1', '9' ) );
  275. get_user_name ( id, szName, charsmax ( szName ) );
  276. formatex ( szBuffer, charsmax ( szBuffer ), " ^"%s^" ^"%s^" ^"b^" ^"a^" // Slot Cumparat cu points", szName, szPassword );
  277.  
  278. ColorChat ( 0, "!x04%s !x03Player !x04%s !x03bought !x04SLOT!", PLUGIN, szName );
  279. ColorChat ( id, "!x04%s !x03YOUR PASSWORD: !x04%s", PLUGIN, szPassword );
  280. ColorChat ( id, "!x04%s !x03USE: !x04setinfo %s %s", PLUGIN, g_password_field, szPassword );
  281.  
  282. set_hudmessage(0, 127, 255, 0.32, 0.15, 0, 6.0, 5.0 );
  283. show_hudmessage(id, "You bought SLOT!^nYour Password: %s", szPassword );
  284.  
  285. write_file ( g_access_file, szBuffer );
  286.  
  287. console_print ( id, "[XMAS Outstanding] SLOT PASSWORD: %s", szPassword );
  288. console_print ( id, "[XMAS Outstanding] SLOT PASSWORD: %s", szPassword );
  289. console_print ( id, "[XMAS Outstanding] SLOT PASSWORD: %s", szPassword );
  290.  
  291. csdm_set_user_points ( id, g_bPoints [ id ] - 1500 );
  292. }
  293. case 6 : {
  294. if ( g_bPoints [ id ] < 9500 )
  295. {
  296. ColorChat ( id, "!x04%s !x03You need !x049500 !x03points to buy !x04ADMIN", PLUGIN );
  297. ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
  298. return PLUGIN_HANDLED;
  299. }
  300.  
  301. if ( is_user_admin ( id ) )
  302. {
  303. ColorChat ( id, "!x04%s !x03You already have !x04ADMIN", PLUGIN );
  304. return PLUGIN_HANDLED;
  305. }
  306.  
  307. new szPassword [ 5 ], szBuffer [ 512 ], szName [ 32 ];
  308.  
  309. get_user_name ( id, szName, charsmax ( szName ) );
  310. formatex ( szPassword, charsmax ( szPassword ), "%c%c%c%c%c", random_num ( 'A', 'Z' ), random_num ( '1', '9' ), random_num ( 'a', 'z' ), random_num ( 'l', 'q' ), random_num ( '3', '6' ) );
  311. formatex ( szBuffer, charsmax ( szBuffer ), " ^"%s^" ^"%s^" ^"%s^" ^"a^" // Admin Cumparat cu points", szName, szPassword, g_admin_flags );
  312.  
  313. ColorChat ( 0, "!x04%s !x03Player !x04%s !x03bought !x04ADMIN", PLUGIN, szName );
  314. ColorChat ( id, "!x04%s !x03YOUR PASSWORD: !x04%s", PLUGIN, szPassword );
  315. ColorChat ( id, "!x04%s !x03USE: !x04setinfo %s %s", PLUGIN, g_password_field, szPassword );
  316.  
  317. set_hudmessage(0, 127, 255, 0.32, 0.15, 0, 6.0, 5.0 );
  318. show_hudmessage(id, "You bought ADMIN!^nYour Password: %s", szPassword );
  319.  
  320. write_file ( g_access_file, szBuffer );
  321.  
  322. console_print ( id, "[XMAS Outstanding] ADMIN PASSWORD: %s", szPassword );
  323. console_print ( id, "[XMAS Outstanding] ADMIN PASSWORD: %s", szPassword );
  324. console_print ( id, "[XMAS Outstanding] ADMIN PASSWORD: %s", szPassword );
  325.  
  326. csdm_set_user_points ( id, g_bPoints [ id ] - 9500 );
  327. }
  328. }
  329.  
  330. return PLUGIN_CONTINUE;
  331. }
  332.  
  333. public TaskAnnounce ( )
  334. {
  335. ColorChat ( 0, "!x04%s !x03Say !x04/stop !x03to stop the radio", PLUGIN );
  336. return PLUGIN_CONTINUE;
  337. }
  338.  
  339.  
  340. public cmd_stop ( id )
  341. {
  342. if ( KISS [ id ] )
  343. {
  344. show_motd ( id, "addons/amxmodx/configs/xmas/radio/kiss_stop.html" );
  345. KISS [ id ] = false;
  346. }
  347.  
  348. if ( DIZZ [ id ] )
  349. {
  350. show_motd ( id, "addons/amxmodx/configs/xmas/radio/dizz_stop.html" );
  351. DIZZ [ id ] = false;
  352. }
  353.  
  354. if ( ZU [ id ] )
  355. {
  356. show_motd ( id, "addons/amxmodx/configs/xmas/radio/zu_stop.html" );
  357. ZU [ id ] = false;
  358. }
  359.  
  360. return PLUGIN_CONTINUE;
  361. }
  362.  
  363. stock ColorChat(const id, const input[], any:...) {
  364. new count = 1, players[32];
  365. static msg[191];
  366. vformat(msg, 190, input, 3);
  367.  
  368. replace_all(msg, 190, "!x04", "!g"); // verde
  369. replace_all(msg, 190, "!x01", "!n"); // galben/alb/negru
  370. replace_all(msg, 190, "!x03", "!g"); // rosu/albastru/gri
  371.  
  372. if (id) players[0] = id; else get_players(players, count, "ch");
  373. {
  374. for (new i = 0; i < count; i++)
  375. {
  376. if (is_user_connected(players[i]))
  377. {
  378. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  379. write_byte(players[i]);
  380. write_string(msg);
  381. message_end();
  382. }
  383. }
  384. }
  385. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement