HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3. #include <fakemeta>
  4. #include <zombieplague>
  5. #include <dhudmessage>
  6.  
  7. new const red_color[14] = { 250, 50, 250, 250, 250, 250, 250, 50, 250, 250, 250, 250, 250, 250 }
  8. new const green_color[14] = { 250, 150, 250, 150, 0, 250, 50, 150, 150, 0, 150, 250, 150, 0 }
  9. new const blue_color[14] = { 250, 250, 50, 50, 0, 50, 250, 250, 50, 0, 250, 50, 50, 0 }
  10. new const cso_kill_headshot[] = "cso/headshot.wav"
  11. new const cso_kill_sounds[14][] =
  12. {
  13. "cso/kill1.wav",
  14. "cso/kill2.wav",
  15. "cso/kill3.wav",
  16. "cso/kill4.wav",
  17. "cso/kill5.wav",
  18. "cso/kill6.wav",
  19. "cso/kill7.wav",
  20. "cso/kill8.wav",
  21. "cso/kill9.wav",
  22. "cso/kill10.wav",
  23. "cso/kill11.wav",
  24. "cso/kill12.wav",
  25. "cso/kill13.wav",
  26. "cso/kill14.wav"
  27. }
  28.  
  29. new Float:g_iTask[33];
  30. new g_iKills[33];
  31.  
  32. public plugin_init()
  33. {
  34. register_plugin("Kill's Like CS Online", "0.1", "fl0wer")
  35.  
  36. RegisterHam(Ham_Killed, "player", "Player_Killed_Post", 1)
  37. RegisterHam(Ham_Player_PostThink, "player", "Player_PostThink_Post", 1)
  38.  
  39.  
  40. }
  41.  
  42. public plugin_precache()
  43. {
  44. for(new i = 0; i < sizeof cso_kill_sounds; i++)
  45. precache_sound(cso_kill_sounds[i])
  46.  
  47. precache_sound(cso_kill_headshot)
  48. }
  49.  
  50. public zp_user_infected_post(id, infector)
  51. {
  52. if(!infector)
  53. return;
  54.  
  55. show_kills(id, infector)
  56. }
  57.  
  58. public Player_Killed_Post(victim, attacker, shouldgib)
  59. {
  60. if(!is_user_connected(attacker))
  61. return;
  62.  
  63. if(victim == attacker)
  64. return;
  65.  
  66. show_kills(victim, attacker)
  67. }
  68.  
  69. public Player_PostThink_Post(id)
  70. {
  71. if(!is_user_alive(id))
  72. return;
  73.  
  74. if(g_iTask[id] + 4.0 <= get_gametime())
  75. {
  76. g_iKills[id] = max(g_iKills[id] -= 1, 0);
  77. g_iTask[id] = get_gametime();
  78. }
  79. }
  80.  
  81. show_kills(victim, attacker)
  82. {
  83. g_iKills[attacker]++;
  84. g_iTask[attacker] = get_gametime();
  85. g_iKills[victim] = 0;
  86. g_iTask[victim] = 0.0;
  87.  
  88. new speak_sound = g_iKills[attacker] - 1;
  89.  
  90. if(get_pdata_int(victim, 75) == HIT_HEAD)
  91. {
  92. client_cmd(attacker, "speak ^"%s^"", cso_kill_headshot)
  93. }
  94. else
  95. {
  96. client_cmd(attacker, "speak ^"%s^"", cso_kill_sounds[speak_sound])
  97. }
  98. set_dhudmessage(red_color[g_iKills[attacker]], green_color[g_iKills[attacker]], blue_color[g_iKills[attacker]], -1.0, 0.25, 0, 0.1, 3.0, 0.1, 0.1, -1)
  99. show_dhudmessage(attacker, "%d KILL!", g_iKills[attacker])
  100. }