Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 1st, 2013  |  syntax: None  |  size: 9.79 KB  |  views: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN_NAME "CSO/Ultimate Sounds"
  5. #define PLUGIN_VERSION "0.7"
  6. #define PLUGIN_AUTHOR "SAMURAI"
  7.  
  8.  
  9. new kills[33] = {0,...};
  10. new deaths[33] = {0,...};
  11. new firstblood
  12. new kill[33][24];
  13.  
  14. #define LEVELS 10
  15. #define hsounds 4
  16. #define knsounds 4
  17. #define fbsounds 2
  18. #define prpsounds 3
  19. #define suicidesounds 3
  20. #define maxdbsounds 2
  21. #define TASK_CLEAR_KILL    100
  22.  
  23. new hsenable
  24. new knifeenable
  25. new firstbloodenable
  26. new nadecvar
  27. new suicidecvar
  28. new cvardouble
  29. new rnstartcvar
  30. new killstreaktype
  31.  
  32.  
  33. new levels[10] = {3, 4, 6, 8, 10, 12,14,15,16,18};
  34.  
  35. new sounds[10][] =
  36. {
  37. "allforce_sound_ultimate/triplekill_ultimate",
  38. "allforce_sound_ultimate/multikill_ultimate",
  39. "allforce_sound_ultimate/ultrakill_ultimate",
  40. "allforce_sound_ultimate/killingspree_ultimate",
  41. "allforce_sound_ultimate/megakill_ultimate",
  42. "allforce_sound_ultimate/holyshit_ultimate",
  43. "allforce_sound_ultimate/ludicrouskill_ultimate",
  44. "allforce_sound_ultimate/rampage_ultimate",
  45. "allforce_sound_ultimate/unstoppable_ultimate",
  46. "allforce_sound_ultimate/monsterkill_ultimate"
  47. };
  48.  
  49. new messages[10][] =
  50. {
  51. "%s: Triple Kill !",
  52. "%s: Multi Kill !",
  53. "%s: Ultra Kill !",
  54. "%s: Killing Spree !",
  55. "%s: Mega Kill !",
  56. "%s: Holy Shit !",
  57. "%s: Ludicrous Kill !",
  58. "%s: Rampage !",
  59. "%s: Unstoppable !",
  60. "%s: M o n s t e R  K i L L ! ! !"
  61. };
  62.  
  63. new hslist[hsounds][] =
  64. {
  65. "allforce_sound_ultimate/headshot1_ultimate"
  66. "allforce_sound_ultimate/headshot2_ultimate"
  67. "allforce_sound_ultimate/headshot3_ultimate"
  68. "allforce_sound_ultimate/headshot4_ultimate"
  69. }
  70.  
  71. new fblist[fbsounds][]=
  72. {
  73. "allforce_sound_ultimate/firstblood1_ultimate"
  74. /firstblood2_ultimate"
  75. }
  76.  
  77. new preplist[prpsounds][]=
  78. {
  79. "allforce_sound_ultimate/prepare1_ultimate"
  80. "allforce_sound_ultimate/prepare2_ultimate"
  81. "allforce_sound_ultimate/prepare3_ultimate"
  82. }
  83.  
  84.  
  85. new fbmessages[3][]=
  86. {
  87. "%s : First Blood !",
  88. "%s Drew First Blood !!!",
  89. "%s First Shot on tha Mark !"
  90. }
  91.  
  92. new hsmessages[4][]=
  93. {
  94. "%s removed %s head !!",
  95. "%s had a superb aim with %s !",
  96. "%s Made a superb headshot to %s!",
  97. "%s down %s with a superb headshot !"
  98. }
  99.  
  100. new knlist[knsounds][]=
  101. {
  102. "allforce_sound_ultimate/knife1_ultimate"
  103. "allforce_sound_ultimate/knife2_ultimate"
  104. "allforce_sound_ultimate/knife3_ultimate"
  105. "allforce_sound_ultimate/knife4_ultimate"
  106. }
  107.  
  108. new knmessages[3][]=
  109. {
  110. "%s sliced and diced %s",
  111. "%s pulled out knife and gutted %s",   
  112. "%s knifed %s"
  113. }
  114.  
  115. new nademessages[3][]=
  116. {
  117. "%s got a big explosion for %s",
  118. "%s made a precision throw to %s",
  119. "%s is good grenadier ! i think he back from the war ..."
  120. }
  121.  
  122. new suicidemess[2][]=
  123. {
  124. "%s knows how the kill command works!",
  125. "%s prefer to kill himself...rather than die on battle land"
  126. }
  127.  
  128. new suicidelist[suicidesounds][]=
  129. {
  130. "allforce_sound_ultimate/suicide1_ultimate"
  131. "allforce_sound_ultimate/suicide2_ultimate"
  132. "allforce_sound_ultimate/suicide3_ultimate"
  133. }
  134.  
  135. new doublelist[maxdbsounds][]=
  136. {
  137. "allforce_sound_ultimate/doublekill1_ultimate"
  138. "allforce_sound_ultimate/doublekill2_ultimate"
  139. }
  140.  
  141. is_mode_set(bits) {
  142.     new mode[9];
  143.     get_cvar_string("ut_killstreak_advanced", mode, 8);
  144.     return read_flags(mode) & bits;
  145. }
  146.  
  147. public plugin_init() {
  148.     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
  149.     killstreaktype = register_cvar("ut_killstreak_advanced", "3");
  150.     register_event("ResetHUD", "reset_hud", "b");
  151.     register_event("HLTV","rnstart","a", "1=0", "2=0");
  152.     register_event("DeathMsg", "event_death", "a");
  153.     hsenable = register_cvar("ut_killstreak_hs","1");
  154.     knifeenable = register_cvar("ut_killstreak_knife","1");
  155.     firstbloodenable = register_cvar("ut_firstblood","1");
  156.     nadecvar = register_cvar("ut_nade_events","1");
  157.     suicidecvar = register_cvar("ut_suicide_events","1");
  158.     cvardouble = register_cvar("ut_doublekill_events","1");
  159.     rnstartcvar = register_cvar("ut_roundcout_sounds","1");
  160.  
  161.     return PLUGIN_CONTINUE;
  162. }
  163.  
  164.  
  165. public event_death(id) {
  166.     new killer = read_data(1);
  167.     new victim = read_data(2);
  168.     new headshot = read_data(3);
  169.     new weapon[24], vicname[32], killname[32]
  170.     read_data(4,weapon,23)
  171.     get_user_name(victim,vicname,31)
  172.     get_user_name(killer,killname,31)
  173.    
  174.    
  175.  
  176.     if(headshot == 1 && get_pcvar_num(hsenable) ==1)
  177.     {
  178.         set_hudmessage(0, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
  179.         show_hudmessage(0, (hsmessages[random_num(0,3)]), killname, vicname)
  180.         new i
  181.         i = random_num(0,hsounds-1)
  182.         client_cmd(0,"spk %s",hslist[i])
  183.     }
  184.  
  185.    
  186.     if(weapon[0] == 'k'  && get_pcvar_num(knifeenable) ==1)
  187.     {
  188.         set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
  189.         show_hudmessage(0, (knmessages[random_num(0,2)]), killname, vicname)
  190.         new r
  191.         r = random_num(0,knsounds-1)
  192.         client_cmd(0,"spk %s",knlist[r])  
  193.     }
  194.    
  195.    
  196.     if(firstblood && killer!=victim && killer>0 && get_pcvar_num(firstbloodenable) ==1)
  197.     {          
  198.         set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
  199.         show_hudmessage(0, (fbmessages[random_num(0,2)]), killname)
  200.         new t
  201.         t = random_num(0,fbsounds-1)
  202.         client_cmd(0,"spk %s",fblist[t])
  203.         firstblood = 0
  204.      }
  205.      
  206.      
  207.     if(weapon[1] == 'r' && get_pcvar_num(nadecvar) ==1)
  208.      {
  209.         set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
  210.         show_hudmessage(0,(nademessages[random_num(0,2)]),killname,vicname)
  211.         client_cmd(0,"spk allforce_sound_ultimate/nade_ultimate")
  212.      }
  213.  
  214.      
  215.     if(killer == victim && get_pcvar_num(suicidecvar) ==1)
  216.     {
  217.         set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
  218.         show_hudmessage(0,(suicidemess[random_num(0,1)]), vicname)
  219.         new z
  220.         z = random_num(0,suicidesounds-1)
  221.         client_cmd(0,"spk %s",suicidelist[z])
  222.      
  223.     }
  224.    
  225.    
  226.     if(kill[killer][0] && equal(kill[killer],weapon) && get_pcvar_num(cvardouble) == 1)
  227.     {
  228.         set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
  229.         show_hudmessage(0,"Wow %s made a double kill", killname)
  230.         kill[killer][0] = 0;
  231.         new q
  232.         q= random_num(0,maxdbsounds-1)
  233.         client_cmd(0,"spk %s",doublelist[q])
  234.     }
  235.    
  236.     else
  237.     {
  238.         kill[killer] = weapon;
  239.         set_task(0.1,"clear_kill",TASK_CLEAR_KILL+killer);
  240.     }
  241.        
  242.        
  243.    
  244.     kills[killer] += 1;
  245.     kills[victim] = 0;
  246.     deaths[killer] = 0;
  247.     deaths[victim] += 1;
  248.  
  249.     for (new i = 0; i < LEVELS; i++)
  250.     {
  251.         if (kills[killer] == levels[i])
  252.         {
  253.             announce(killer, i);
  254.             return PLUGIN_CONTINUE;
  255.         }
  256.     }
  257.  
  258.     return PLUGIN_CONTINUE;
  259. }
  260.  
  261. announce(killer, level)
  262. {
  263.        
  264.     new name[33]
  265.     new r = random(256)
  266.     new g = random(256)
  267.     new b = random(256)
  268.  
  269.     get_user_name(killer, name, 32);
  270.     set_hudmessage(r,g,b, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2);
  271.  
  272.     if( (get_pcvar_num(killstreaktype) <= 0 ) || get_pcvar_num(killstreaktype) > 3)
  273.     return PLUGIN_HANDLED;
  274.    
  275.    
  276.    
  277.     if(get_pcvar_num(killstreaktype) == 1)
  278.     {
  279.         show_hudmessage(0, messages[level], name);
  280.     }
  281.        
  282.     if(get_pcvar_num(killstreaktype) == 2)
  283.     {
  284.         client_cmd(0, "spk %s", sounds[level]);
  285.     }
  286.  
  287.     if(get_pcvar_num(killstreaktype) == 3)
  288.     {
  289.         show_hudmessage(0, messages[level], name);
  290.         client_cmd(0, "spk %s", sounds[level]);
  291.     }
  292.        
  293.     return PLUGIN_CONTINUE;
  294.        
  295. }
  296.  
  297.  
  298. public reset_hud(id)
  299. {
  300.     firstblood = 1
  301.     if (is_mode_set(16)) {
  302.       if (kills[id] > levels[0]) {
  303.         client_print(id, print_chat,
  304.                      "* You are on a killstreak with %d kills.", kills[id]);
  305.       } else if (deaths[id] > 1) {
  306.         client_print(id, print_chat,
  307.                      "* Take care, you are on a deathstreak with %d deaths in a row.", deaths[id]);
  308.  
  309.         }
  310.     }
  311. }
  312.  
  313. public rnstart(id)
  314. {
  315.     if(get_pcvar_num(rnstartcvar) == 1)
  316.     {
  317.     firstblood = 1  
  318.     set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
  319.     show_hudmessage(0, "Prepare To Fight!")
  320.     new q
  321.     q = random_num(0,prpsounds-1)
  322.     client_cmd(0,"spk %s",preplist[q])
  323.     }
  324. }
  325.  
  326. public client_connect(id) {
  327.     kills[id] = 0;
  328.     deaths[id] = 0;
  329. }
  330.  
  331. public clear_kill(taskid)
  332.  {
  333.     new id = taskid-TASK_CLEAR_KILL;
  334.     kill[id][0] = 0;
  335.  }
  336.  
  337. public plugin_precache()
  338. {
  339. precache_sound("allforce_sound_ultimate/triplekill_ultimate.wav")
  340. precache_sound("allforce_sound_ultimate/multikill_ultimate.wav")
  341. precache_sound("allforce_sound_ultimate/ultrakill_ultimate.wav")
  342. precache_sound("allforce_sound_ultimate/killingspree_ultimate.wav")
  343. precache_sound("allforce_sound_ultimate/megakill_ultimate.wav")
  344. precache_sound("allforce_sound_ultimate/holyshit_ultimate.wav")
  345. precache_sound("allforce_sound_ultimate/ludicrouskill_ultimate.wav")
  346. precache_sound("allforce_sound_ultimate/rampage_ultimate.wav")
  347. precache_sound("allforce_sound_ultimate/unstoppable_ultimate.wav")
  348. precache_sound("allforce_sound_ultimate/monsterkill_ultimate.wav")
  349. precache_sound("allforce_sound_ultimate/headshot1_ultimate.wav")
  350. precache_sound("allforce_sound_ultimate/headshot2_ultimate.wav")
  351. precache_sound("allforce_sound_ultimate/knife1_ultimate.wav")
  352. precache_sound("allforce_sound_ultimate/knife2_ultimate.wav")
  353. precache_sound("allforce_sound_ultimate/firstblood1_ultimate.wav")
  354. precache_sound("allforce_sound_ultimate/firstblood2_ultimate.wav")
  355. precache_sound("allforce_sound_ultimate/prepare1_ultimate.wav")
  356. precache_sound("allforce_sound_ultimate/prepare2_ultimate.wav")
  357. precache_sound("allforce_sound_ultimate/prepare3_ultimate.wav")
  358. precache_sound("allforce_sound_ultimate/nade_ultimate.wav")
  359. precache_sound("allforce_sound_ultimate/suicide1_ultimate.wav")
  360. precache_sound("allforce_sound_ultimate/suicide2_ultimate.wav")
  361. precache_sound("allforce_sound_ultimate/suicide3_ultimate.wav")
  362. precache_sound("allforce_sound_ultimate/suicide4_ultimate.wav")
  363. precache_sound("allforce_sound_ultimate/doublekill1_ultimate.wav")
  364. precache_sound("allforce_sound_ultimate/doublekill2_ultimate.wav")
  365. }