FlacoBey

Untitled

Jan 5th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. public OnPluginStart()
  5. {
  6.     HookEvent("infected_hurt", _DM_InfectedHurt_Event);
  7. }
  8.  
  9. public Action:_DM_InfectedHurt_Event(Handle:event, const String:name[], bool:dontBroadcast)
  10. {
  11.     new dmg_health = GetEventInt(event,"amount");
  12.     new entity = GetEventInt(event, "entityid");
  13.     new damagetype = GetEventInt(event, "type");
  14.     new eventhealth = GetEntProp(entity, Prop_Data, "m_iHealth");
  15.     new client = GetClientOfUserId(GetEventInt(event,   "attacker"));
  16.    
  17.     PrintToChatAll("хп=%i", eventhealth);
  18.     PrintToChatAll("дамаг=%i", dmg_health);
  19.    
  20.     float vecVel[3];
  21.     GetEntPropVector(client, Prop_Data, "m_vecVelocity", vecVel);
  22.     vecVel[0] += 0;
  23.     vecVel[1] += 0;
  24.     vecVel[2] += 0;
  25.     TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVel)
  26.     if(damagetype == 128)
  27.     {
  28.         SetEventInt(event, "amount", 0);
  29.         SetEntProp(entity, Prop_Data, "m_iHealth", 100);
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment