Привет народ. вообщем сообразил вот такую штуку но не работает norecoil почему так?
Код:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#define FLAG_ACCESS ADMIN_ADMIN // флаг доступа
#define DMG_HEGRENADE (1<<24)
const Float:fMultiDmg = 1.5 // Умножения урона
new bool:bIsAdmin[33]
new bool:g_norecoil[33]
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
}
public client_putinserver(id)
{
if(get_user_flags(id) & FLAG_ACCESS) bIsAdmin[id] = true
else bIsAdmin[id] = false;
if(get_user_flags(id) & FLAG_ACCESS) g_norecoil[id] = true
else g_norecoil[id] = false;
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(!is_user_connected(attacker) || victim == attacker)
return HAM_IGNORED
if( damage_type & DMG_HEGRENADE )
return HAM_IGNORED
if(bIsAdmin[attacker])
{
SetHamParamFloat(4, damage * fMultiDmg)
}
return HAM_IGNORED
}
public func_prethink(id)
{
if(!is_user_alive(id) && !g_norecoil[id])
return;
set_pev(id,pev_punchangle,{ 0.0,0.0,0.0 });
}
public client_disconnect(id)
{
g_norecoil[id] = false;
}