HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include < amxmodx >
  2. #include < csstats >
  3. #include < dhudmessage >
  4.  
  5. #define IME "Frags, HS, Rank"
  6. #define VERZIJA "1.1"
  7. #define AUTOR "FreeStyLe | Malli Bojan"
  8.  
  9. new g_MsgSync;
  10. new g_iMsgScreenFade;
  11. new FRAGS[33], HS[33];
  12. new CT_SCORE, TERRORIST_SCORE;
  13. new cvar_red, cvar_green, cvar_blue, cvar_x, cvar_y;
  14.  
  15. public plugin_init( )
  16. {
  17. register_plugin(IME,VERZIJA,AUTOR);
  18.  
  19. register_event ( "DeathMsg", "fw_PlayerDeath", "a" );
  20. register_event ( "TeamScore", "skor", "a" );
  21. register_event ( "DeathMsg", "EventDeath", "a", "1>0", "3=1" );
  22.  
  23. g_MsgSync = CreateHudSyncObj ( );
  24.  
  25. g_iMsgScreenFade = get_user_msgid( "ScreenFade" );
  26.  
  27. cvar_red = register_cvar ( "hud_red", "0" );
  28. cvar_green = register_cvar ( "hud_green", "255" );
  29. cvar_blue = register_cvar ( "hud_blue", "255" );
  30. cvar_x = register_cvar ( "hud_x", "0.02" );
  31. cvar_y = register_cvar ( "hud_y", "-1.0" );
  32. }
  33.  
  34. public client_connect ( id )
  35. {
  36. FRAGS[id] = 0;
  37. HS[id] = 0;
  38.  
  39. set_task ( 1.0, "fw_ShowHud", id, _, _, "b" );
  40. }
  41.  
  42. public skor()
  43. {
  44. new team[32];
  45. read_data(1,team,31);
  46. if (equal(team,"CT"))
  47. {
  48. CT_SCORE = read_data(2);
  49. }
  50. else if (equal(team,"TERRORIST"))
  51. {
  52. TERRORIST_SCORE = read_data(2);
  53. }
  54. }
  55.  
  56. public fw_PlayerDeath ()
  57. {
  58. new killer = read_data(1);
  59. new victim = read_data(2);
  60. new headshot = read_data(3);
  61.  
  62. if ( killer == victim || get_user_team ( killer ) == get_user_team ( victim ) )
  63. return PLUGIN_HANDLED;
  64.  
  65. if ( headshot )
  66. {
  67. HS[killer]++
  68. }
  69. FRAGS[killer]++
  70.  
  71. FRAGS[victim] = 0;
  72. HS[victim] = 0;
  73.  
  74. return PLUGIN_HANDLED;
  75. }
  76.  
  77. public fw_ShowHud ( id )
  78. {
  79. new stats[8], bodyhits[8];
  80. new RANK = get_user_stats ( id, stats, bodyhits );
  81.  
  82. set_hudmessage ( get_pcvar_num ( cvar_red ), get_pcvar_num ( cvar_green ), get_pcvar_num ( cvar_blue ), get_pcvar_float ( cvar_x ), get_pcvar_float ( cvar_y ) );
  83. ShowSyncHudMsg(id, g_MsgSync, "%i ÖLÉS ( %i HS )^nRank: %i/%i", FRAGS[id], HS[id], RANK, get_statsnum ( ) );
  84.  
  85. set_dhudmessage(0, 70, 200, -1.0, 0.03, 0, 0.5, 2.0, 0.08, 2.0, true)
  86. show_dhudmessage ( 0,"[CT] Csapat %d | |", CT_SCORE );
  87.  
  88. set_dhudmessage(200, 0, 0, -1.0, 0.03, 0, 0.5, 2.0, 0.08, 2.0, true)
  89. show_dhudmessage ( 0," | | %d [T] Csapat", TERRORIST_SCORE );
  90. }
  91.  
  92. public EventDeath( )
  93. {
  94. message_begin( MSG_ONE_UNRELIABLE, g_iMsgScreenFade, _, read_data( 1 ) );
  95. write_short( 1 << 10 );
  96. write_short( 1 << 10 );
  97. write_short( 0x0000 );
  98. write_byte( 0 );
  99. write_byte( 0 );
  100. write_byte( 255 );
  101. write_byte( 255 );
  102. message_end( );
  103. }
  104.