Advertisement
Guest User

Untitled

a guest
Jul 13th, 2013
1,209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #include <fun>
  4.  
  5.  
  6.  
  7. new const Cvars[][] = { "bhp_killhp", "bhp_hshp", "bhp_hehp", "bhp_knifehp" };
  8.  
  9. new const Values[] = { 5, 10, 20, 15 };
  10.  
  11.  
  12.  
  13. new const HudMessages[][] = { "for kill", "for headshot", "for kill with HE", "for knife kill" };
  14.  
  15.  
  16.  
  17. new g_Cvars[33], HudMsg[33], Health[33], g_HudSyncObj;
  18.  
  19.  
  20.  
  21. public plugin_init()
  22.  
  23. {
  24.  
  25. register_plugin("Bonus HP", "v1.1", "N3u[T]r4L & AlerteR");
  26.  
  27.  
  28.  
  29. for(new i = 0;i < sizeof Cvars;i++)
  30.  
  31. g_Cvars[i] = register_cvar(Cvars[i], Values[i]);
  32.  
  33.  
  34.  
  35. g_HudSyncObj = CreateHudSyncObj();
  36.  
  37.  
  38.  
  39. register_event("DeathMsg", "PlayerDeath", "ade");
  40.  
  41. }
  42.  
  43.  
  44.  
  45. public PlayerDeath()
  46.  
  47. {
  48.  
  49. new Attacker = read_data(1);
  50.  
  51. new Victim = read_data(2);
  52.  
  53. new Headshot = read_data(3);
  54.  
  55.  
  56.  
  57. new HEAttack = get_user_weapon(Attacker) == CSW_HEGRENADE;
  58.  
  59. new KnifeAttack = get_user_weapon(Attacker) == CSW_KNIFE;
  60.  
  61.  
  62.  
  63. set_hudmessage(60, 200, 25, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.2, 2);
  64.  
  65.  
  66.  
  67. if(Attacker != Victim && is_user_connected(Attacker))
  68.  
  69. {
  70.  
  71.  
  72.  
  73. Health[Attacker] += get_pcvar_num(g_Cvars[1]);
  74.  
  75. HudMsg[Attacker] += 1;
  76.  
  77.  
  78.  
  79. if(Headshot)
  80.  
  81. {
  82.  
  83. Health[Attacker] += get_pcvar_num(g_Cvars[2]);
  84.  
  85. HudMsg[Attacker] += 2;
  86.  
  87. }
  88.  
  89.  
  90.  
  91. if(HEAttack)
  92.  
  93. {
  94.  
  95. Health[Attacker] += get_pcvar_num(g_Cvars[3]);
  96.  
  97. HudMsg[Attacker] += 3;
  98.  
  99. }
  100.  
  101.  
  102.  
  103. if(KnifeAttack)
  104.  
  105. {
  106.  
  107. Health[Attacker] += get_pcvar_num(g_Cvars[4]);
  108.  
  109. HudMsg[Attacker] += 4;
  110.  
  111. }
  112.  
  113.  
  114.  
  115. ShowSyncHudMsg(Attacker, g_HudSyncObj, "You've got %i HP %s.", Health[Attacker], HudMessages[HudMsg[Attacker]]);
  116.  
  117.  
  118.  
  119. set_user_health(Attacker, get_user_health(Attacker) + Health[Attacker]);
  120.  
  121. }
  122.  
  123.  
  124.  
  125. return PLUGIN_CONTINUE;
  126.  
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement