Advertisement
Sokarbestfrag

Untitled

Feb 25th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fun>
  4.  
  5. #define Tag "[Bonus]"
  6.  
  7. static const PLUGIN_NAME[] = "BonusHP";
  8. static const PLUGIN_AUTHOR[] = "ExoTiQ";
  9. static const PLUGIN_VERSION[] = "1.0";
  10.  
  11. new cStatus, cMaxHealth;
  12. new cKill, cKnife, cHeadshot, cKnifeHeadshot;
  13.  
  14. public plugin_init() {
  15. register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
  16. /* Modificat de ExoTiQ */
  17. /* Cvar */
  18. cStatus = register_cvar("bonus_status", "1");
  19. cMaxHealth = register_cvar("bonus_maxhealth", "10000");
  20. /* Bonus */
  21. cKill = register_cvar("bonus_kill", "15");
  22. cKnife = register_cvar("bonus_knife", "40");
  23. cHeadshot = register_cvar("bonus_headshot", "35");
  24. cKnifeHeadshot = register_cvar("bonus_knifeheadshot", "100");
  25.  
  26. /* Player Killed */
  27. register_event( "DeathMsg", "EventDeathMsg", "a", "1>0" );
  28. }
  29. /*
  30. Bonus:
  31. - Player Killed
  32. */
  33. public EventDeathMsg() {
  34. new killer = read_data(1);
  35. new victim = read_data(2);
  36. new headshot = read_data(3);
  37. new weapon = get_user_weapon(killer);
  38. new num;
  39.  
  40. if(killer == victim || !get_pcvar_num(cStatus) || !is_user_connected(victim) || !is_user_alive(killer))
  41. return PLUGIN_HANDLED;
  42.  
  43. if(headshot && weapon == CSW_KNIFE) {
  44. num = get_pcvar_num(cKnifeHeadshot)
  45. GiveHealth(killer, num)
  46. HudMessage(killer, "Vindecat cu +%iHP !", num)
  47. } else if(headshot) {
  48. num = get_pcvar_num(cHeadshot)
  49. GiveHealth(killer, num)
  50. HudMessage(killer, "Vindecat cu +%iHP !", num)
  51. } else if(weapon == CSW_KNIFE) {
  52. num = get_pcvar_num(cKnife)
  53. GiveHealth(killer, num)
  54. HudMessage(killer, "Vindecat cu +%iHP !", num)
  55. } else {
  56. num = get_pcvar_num(cKill)
  57. GiveHealth(killer, num)
  58. HudMessage(killer, "Vindecat cu +%iHP !", num)
  59. }
  60. return PLUGIN_CONTINUE;
  61. }
  62. /*
  63. Bonus:
  64. - Give Health
  65. - Hud Message
  66. */
  67. GiveHealth(id, count)
  68. set_user_health(id, min( (get_user_health(id) + count), get_pcvar_num(cMaxHealth) ))
  69. stock HudMessage(const id, const input[], any:...) {
  70. static msg[191];
  71. vformat(msg, 190, input, 3);
  72.  
  73. set_hudmessage(127, 170, 255, 0.27, 0.14, 0, 5.0, 5.0, 0.0, 0.0, -1);
  74. show_hudmessage(id, "%s^n%s", Tag, msg)
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement