/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <engine>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Elitarny Snajper";
new const opis[] = "1/1 z AWP, 1/2 z noza(PPM), 1/5 z noza(LPM), podczas kucania widocznosc spada o 60 procent.";
new const bronie = 1<<CSW_DEAGLE | 1<<CSW_AWP;
new const zdrowie = 20;
new const kondycja = 25;
new const inteligencja = 0;
new const wytrzymalosc = 20;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
ma_klase[id] = true;
public cod_class_disabled(id)
{
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
ma_klase[id] = false;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_KNIFE && damage > 20.0 && random_num(1,2) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_KNIFE && random_num(1,5) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_AWP && random_num(1,1) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
public client_PreThink(id)
{
if(!ma_klase[id])
return;
new button = get_user_button(id);
if(button & IN_DUCK)
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 102);
else
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
}