Advertisement
gal_17

fragcounter

Oct 19th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. new g_hs[33]
  4.  
  5. public plugin_init()
  6. {
  7.     register_plugin("Frag Counter", "1.0", "RateX")  
  8.     register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
  9.     set_task(1.0, "show_stat", _, _, _, "b")
  10. }
  11.  
  12. public message_DeathMsg(msg_id, msg_dest, id)
  13. {
  14.     static hshot, iAttacker, iVictim
  15.    
  16.     iAttacker = get_msg_arg_int(1)
  17.     iVictim = get_msg_arg_int(2)
  18.     hshot = get_msg_arg_int(3)
  19.    
  20.     if(!is_user_connected(iAttacker) || iAttacker == iVictim)
  21.         return PLUGIN_CONTINUE
  22.    
  23.     if(hshot)
  24.     {
  25.         g_hs[iAttacker]++
  26.     }
  27.     return PLUGIN_CONTINUE
  28. }
  29.  
  30. public show_stat()
  31. {
  32.     new players[32], inum
  33.     static id
  34.     get_players(players,inum)
  35.     for(new i;i<inum;i++) {
  36.         id = players[i]
  37.        
  38.         if(!is_user_connected(id))
  39.             continue
  40.        
  41.         new g_kill
  42.         g_kill = get_user_frags(id)
  43.         set_hudmessage(0, 255, 0, 0.05, 0.30, 0, 2.0, 2.0)
  44.         show_hudmessage(id, "Kill: %i(%i HS)", g_kill, g_hs[id])
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement