Модератор
Скриптер
Пользователь
- Сообщения
- 1,420
- Реакции
- 2,511
- Помог
- 58 раз(а)
Альтернативный вариант:
Код:
#include <amxmodx>
#include <reapi>
public plugin_init()
{
register_plugin("Regeneration when falling", "1.0", "w0w");
RegisterHookChain(RG_CBasePlayer_TakeDamage, "refwd_PlayerTakeDamage_Post", true);
}
public refwd_PlayerTakeDamage_Post(iVictim, iInflictor, iAttacker, Float:flDamage, iBitsDamageType)
{
if(!(iBitsDamageType & DMG_FALL))
return;
new Float:flHealth;
get_entvar(iVictim, var_health, flHealth);
if((flHealth + flDamage) < 30.0)
return;
set_entvar(iVictim, var_health, 100.0);
set_hudmessage(42, 255, 85, 0.0, 0.90, 0, 6.0, 3.0);
show_hudmessage(iVictim, "Fall dmg: %0.f", flDamage);
}
Код:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Regeneration when falling", "1.0", "w0w");
RegisterHamPlayer(Ham_TakeDamage, "hamfwd_PlayerTakeDamage_Post", true);
}
public hamfwd_PlayerTakeDamage_Post(iVictim, iInflictor, iAttacker, Float:flDamage, iBitsDamageType)
{
if(!(iBitsDamageType & DMG_FALL))
return;
new Float:flHealth;
pev(iVictim, pev_health, flHealth);
if((flHealth + flDamage) < 30.0)
return;
set_pev(iVictim, pev_health, 100.0);
set_hudmessage(42, 255, 85, 0.0, 0.90, 0, 6.0, 3.0);
show_hudmessage(iVictim, "Fall dmg: %0.f", flDamage);
}