FlacoBey

Untitled

Dec 25th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #pragma semicolon 1
  2. #include <sourcemod>
  3.  
  4. #define HITGROUP_HEAD 0
  5.  
  6. #define ZC_SMOKER       1
  7. #define ZC_HUNTER       3
  8.  
  9.  
  10. public OnPluginStart()
  11. {
  12.     HookEvent("player_hurt", Event_PlayerHurt);
  13. }
  14.  
  15. public Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBrodcast)
  16. {
  17.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  18.     new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  19.     new iClass = GetEntProp(client, Prop_Send, "m_zombieClass");
  20.     new dmg = GetClientOfUserId(GetEventInt(event, "dmg_health"));
  21.     if (attacker && attacker != client)
  22.     {
  23.         new hitgroup = GetEventInt(event, "hitgroup");
  24.        
  25.         if (hitgroup == HITGROUP_HEAD && iClass == ZC_SMOKER & ZC_HUNTER)
  26.         {
  27.             dmg *= 0.1;
  28.         }
  29.     }
  30.     return Plugin_Changed;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment