HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4.  
  5. new nk, hs
  6.  
  7. public plugin_precache()
  8. {
  9. nk = precache_model("sprites/nk.spr")
  10. hs = precache_model("sprites/hs.spr")
  11. precache_sound("misc/effect.wav")
  12. }
  13. public plugin_init()
  14. {
  15. register_plugin("Death Sprite Effect","1.0","RaZzoR")
  16. register_event("DeathMsg","onDeath","a")
  17. }
  18. public onDeath()
  19. {
  20. new name[32]
  21. new victim = read_data(2)
  22. new headshot = read_data(3)
  23.  
  24. get_user_name(victim, name,31)
  25. if(headshot == 0)
  26. {
  27. show_sprite(victim, nk)
  28. emit_sound(victim,CHAN_ITEM,"misc/effect.wav",1.0,ATTN_NORM,0,PITCH_NORM )
  29. }
  30. if(headshot == 1)
  31. {
  32. show_sprite(victim, hs)
  33. emit_sound(victim,CHAN_ITEM,"misc/effect.wav",1.0,ATTN_NORM,0,PITCH_NORM )
  34. }
  35.  
  36. return PLUGIN_CONTINUE
  37. }
  38. public show_sprite(id, sprite)
  39. {
  40. if(!is_user_connected(id))
  41. return PLUGIN_CONTINUE
  42.  
  43.  
  44.  
  45. static origin[3]
  46. get_user_origin(id, origin)
  47.  
  48. message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
  49. write_byte(TE_SPRITE)
  50. write_coord(origin[0])
  51. write_coord(origin[1])
  52. write_coord(origin[2]+60)
  53. write_short(sprite)
  54. write_byte(10)
  55. write_byte(250)
  56. message_end()
  57.  
  58. return PLUGIN_CONTINUE
  59. }