Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- public OnPluginStart()
- {
- HookEvent("infected_hurt", _DM_InfectedHurt_Event);
- }
- public Action:_DM_InfectedHurt_Event(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
- new entity = GetEventInt(event, "entityid");
- new damagetype = GetEventInt(event, "type");
- new dmg_health = GetEventInt(event, "dmg_health");
- new eventhealth = GetEventInt(event, "health");
- if(damagetype == 128)
- {
- float current[3];
- GetEntPropVector(entity, PropType:1, "m_vecOrigin", current, 0);
- current[0] += 4;
- current[0] += 4;
- TeleportEntity(entity, current, NULL_VECTOR, NULL_VECTOR);
- SetEventInt(event, "amount", 0);
- SetEntProp(entity, Prop_Data, "m_iHealth", 52);
- }
- else
- {
- char weaponname[32];
- GetClientWeapon(attacker, weaponname, sizeof(weaponname));
- int damage = (dmg_health * 0) + 25;
- int health = eventhealth - damage;
- SetEntProp(entity, Prop_Data, "m_iHealth", health);
- SetEventInt(event, "dmg_health", damage);
- SetEventInt(event, "health", health);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment