HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2.  
  3. enum _:DeathSoundSettings
  4. {
  5. i_ConsecutiveKill,
  6. szSoundToPlay[63],
  7. szSendChatToAll[63]
  8. }
  9.  
  10. new const LeagueDeathSounds[][DeathSoundSettings] =
  11. {
  12. { 1, "misc/leaguesounds/File0016.wav", "&x01megölt egy ellenfelet." },
  13. { 2, "misc/leaguesounds/File0006.wav", "&x01Kettős gyilkosság." },
  14. { 3, "misc/leaguesounds/File0037.wav", "&x01Hármas gyilkosság." },
  15. { 4, "misc/leaguesounds/File0032.wav", "&x01Négyszeres gyilkosság." },
  16. { 5, "misc/leaguesounds/File0030.wav", "&x01Ötszörös gyilkosság." },
  17. { 6, "misc/leaguesounds/File0126.wav", "&x01Hatszoros gyilkosság." },
  18. { 7, "misc/leaguesounds/File0002.wav", "&x01Ász." },
  19. { 10, "misc/leaguesounds/File0059.wav", "&x01Gyilkológép." },
  20. { 13, "misc/leaguesounds/File0065.wav", "&x01Tombol." },
  21. { 16, "misc/leaguesounds/File0070.wav", "&x01Megállíthatatlán." },
  22. { 19, "misc/leaguesounds/File0073.wav", "&x01Legyőzhetetlen." },
  23. { 22, "misc/leaguesounds/File0086.wav", "&x01Legendás." },
  24. { 25, "misc/leaguesounds/File0079.wav", "&x01Istenszabású." }
  25. }
  26.  
  27. new g_CurrentKill[33], DEATHSOUND;
  28.  
  29. new const ShutDownSound[] = { "misc/leaguesounds/File0054.wav" };
  30. new const ShutDownChatMsg[] = { "&x04 Megállítva." };
  31.  
  32. public plugin_init()
  33. {
  34. register_plugin("League of Legends Sounds", "1.0", "JackEyedJones");
  35.  
  36. register_event("DeathMsg", "OnPlayerKilled", "a");
  37. }
  38.  
  39. public plugin_precache()
  40. {
  41. for(new AllSounds = 0; AllSounds < sizeof(LeagueDeathSounds); AllSounds++)
  42. {
  43. precache_sound(LeagueDeathSounds[AllSounds][szSoundToPlay]);
  44. precache_sound(ShutDownSound);
  45. }
  46. }
  47.  
  48. public OnPlayerKilled()
  49. {
  50. new victim = read_data(2), attacker = get_user_attacker(victim), szAttackerName[63];
  51. get_user_name(attacker, szAttackerName, charsmax(szAttackerName));
  52.  
  53. if(!is_user_connected(victim) || is_user_alive(victim))
  54. return PLUGIN_CONTINUE;
  55.  
  56. if(is_user_alive(attacker) && !is_user_alive(victim))
  57. {
  58. g_CurrentKill[attacker]++;
  59.  
  60. for(DEATHSOUND = 0; DEATHSOUND < sizeof(LeagueDeathSounds); DEATHSOUND++)
  61. {
  62. if(g_CurrentKill[attacker] == LeagueDeathSounds[DEATHSOUND][i_ConsecutiveKill])
  63. {
  64. if(g_CurrentKill[victim] == g_CurrentKill[attacker])
  65. {
  66. client_cmd(0, "stopsound; spk ^"%s^"", ShutDownSound);
  67. g_CurrentKill[victim] = 0;
  68.  
  69. set_hudmessage(random(255), random(255), random(255), .holdtime = 1.5);
  70. show_hudmessage(0, "%s %s", szAttackerName, ShutDownChatMsg);
  71. return PLUGIN_CONTINUE;
  72. }
  73.  
  74. client_cmd(0, "stopsound; spk ^"%s^"", LeagueDeathSounds[DEATHSOUND][szSoundToPlay]);
  75.  
  76. set_hudmessage(random(255), random(255), random(255), .holdtime = 1.5);
  77. show_hudmessage(0, "%s %s", szAttackerName, LeagueDeathSounds[DEATHSOUND][szSendChatToAll]);
  78. }
  79. }
  80.  
  81. g_CurrentKill[victim] = 0;
  82. }
  83.  
  84. return PLUGIN_CONTINUE;
  85. }
  86.