HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2.  
  3. #define PLUGIN "Bullet Damage"
  4. #define AUTHOR "ConnorMcLeod"
  5. #define VERSION "1.0"
  6.  
  7. #define MAX_PLAYERS 32
  8.  
  9. new const Float:g_flCoords[][] =
  10. {
  11. {0.30, 0.55},
  12. {0.35, 0.52},
  13. {0.40, 0.48},
  14. {0.45, 0.45},
  15. {0.50, 0.42},
  16. {0.55, 0.45},
  17. {0.60, 0.49},
  18. {0.65, 0.54}
  19. }
  20.  
  21. new g_iPlayerPos[MAX_PLAYERS+1]
  22.  
  23. new g_iMaxPlayers
  24. new g_pCvarEnabled
  25.  
  26. public plugin_init()
  27. {
  28. register_plugin(PLUGIN, VERSION, AUTHOR)
  29.  
  30. g_pCvarEnabled = register_cvar("bullet_damage", "1")
  31.  
  32. register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
  33.  
  34. g_iMaxPlayers = get_maxplayers()
  35. }
  36.  
  37. public Event_Damage( iVictim )
  38. {
  39. if( get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
  40. {
  41. new id = get_user_attacker(iVictim)
  42. if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )
  43. {
  44. new iPos = ++g_iPlayerPos[id]
  45. if( iPos == sizeof(g_flCoords) )
  46. {
  47. iPos = g_iPlayerPos[id] = 0
  48. }
  49. set_hudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
  50. show_hudmessage(id, "|-%d HP|", read_data(2))
  51. }
  52. }
  53. }
  54.