HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <reapi>
  3.  
  4. new const FFA_MODE = 0 // Режим Free For All. Замените на 1 чтобы включить
  5.  
  6. public plugin_init()
  7. {
  8. register_plugin("Real Damage [ReApi]", "2.0", "Leo_[BH]")
  9.  
  10. RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage_Pre", 0);
  11. }
  12.  
  13. public CBasePlayer_TakeDamage_Pre(const this, pevInflictor, pevAttacker, Float:flDamage, bitsDamageType)
  14. {
  15. if(bitsDamageType & DMG_BULLET)
  16. {
  17. if(get_user_team(this) != get_user_team(pevAttacker) || FFA_MODE)
  18. {
  19. new Float:hp = get_entvar(this, var_health);
  20.  
  21. if(flDamage > hp)
  22. {
  23. if(is_user_alive(this)) rg_set_user_armor(this, 0, ARMOR_NONE);
  24. SetHookChainArg(4, ATYPE_FLOAT, hp);
  25. }
  26. }
  27. }
  28.  
  29. return HC_CONTINUE;
  30. }
  31.