Код:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define MAX_PLAYERS 32
#define DEFAULT_FOV 90
#define TIME_PRO_REACTION 0.2
new Float:flFastZoom[MAX_PLAYERS + 1];
const m_iId = 43;
const m_pPlayer = 41;
const m_pActiveItem = 373;
const m_iFOV = 363;
const m_iLastZoom = 109;
const XO_CBASEPLAYERITEM = 4;
public plugin_init()
{
RegisterHam(Ham_Killed,"player","CBasePlayer__Killed",1);
RegisterHam(Ham_Weapon_SecondaryAttack,"weapon_awp","CBasePlayerWeapon_SecondAttack",1);
}
public CBasePlayerWeapon_SecondAttack(ent)
{
new id = get_pdata_cbase(ent,m_pPlayer,XO_CBASEPLAYERITEM);
if(get_pdata_int(id,m_iFOV) != DEFAULT_FOV)
flFastZoom[id] = get_gametime() + TIME_PRO_REACTION;
return HAM_IGNORED;
}
public CBasePlayer__Killed(victim,attacker,shouldgib)
{
if(!attacker || attacker == victim || !is_user_connected(victim))
return HAM_IGNORED;
new iLastFov,pActiveItem,weaponID = 0;
pActiveItem = get_pdata_cbase(attacker,m_pActiveItem);
if(pActiveItem)
weaponID = get_pdata_int(pActiveItem,m_iId);
if(weaponID != CSW_AWP)
return HAM_IGNORED;
iLastFov = get_pdata_int(attacker,m_iLastZoom);
client_print(attacker,print_chat,"* Ohhh, you killed with awp - %s",(iLastFov < DEFAULT_FOV) ? "ZOOM" : "NO ZOOM");
if(flFastZoom[attacker] > get_gametime())
client_print(attacker,print_chat,"* Ohhh, you killed with awp and yet with FASTZOOM");
return HAM_IGNORED;
}