MegastoRM

fade

Jan 25th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4.  
  5. new const HP_ADD[2] = {
  6. 25,
  7. 15
  8. }
  9.  
  10. public plugin_init() {
  11. register_plugin("","","")
  12. register_event("DeathMsg", "hook_death", "a", "1>0")
  13. // Add your code here...
  14. }
  15.  
  16. public hook_death()
  17. {
  18. new killer = read_data(1)
  19. new victim = read_data(2)
  20.  
  21. if(!is_user_connected(killer))
  22. return;
  23.  
  24. set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  25.  
  26. if ((read_data(3) == 1) && (read_data(5) == 0))
  27. {
  28. set_user_health(killer, get_user_health(killer)+HP_ADD[0])
  29. show_hudmessage(killer, "+%d hp", HP_ADD[0])
  30. }
  31. else
  32. {
  33. set_user_health(killer, get_user_health(killer)+HP_ADD[1])
  34. show_hudmessage(killer, "+%d hp", HP_ADD[1])
  35. }
  36.  
  37. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, killer)
  38. write_short(1<<10)
  39. write_short(1<<10)
  40. write_short(0x0000)
  41. write_byte(0)
  42. write_byte(200)
  43. write_byte(0)
  44. write_byte(75)
  45. message_end()
  46.  
  47. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, victim)
  48. write_short(1<<10)
  49. write_short(1<<10)
  50. write_short(0x0000)
  51. write_byte(200)
  52. write_byte(0)
  53. write_byte(0)
  54. write_byte(75)
  55. message_end()
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment