/* Plugin generated by
AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <cstrike>
#include <hamsandwich>
new const perk_name[] = "Fart Gogusia";
new const perk_desc[] = "Dostajesz Deagle oraz 1/4 na natychmiastowe zabicie z niego";
new bool:ma_perk[32]
public plugin_init()
{
register_plugin(perk_name, "1.0", "Czyzyk");
cod_register_perk(perk_name, perk_desc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage", 1)
}
public cod_perk_enabled(id)
{
cod_give_weapon(id, CSW_DEAGLE)
ma_perk[id] = true
}
public cod_perk_disabled(id)
{
cod_take_weapon(id, CSW_DEAGLE)
ma_perk[id] = false
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
new liczba = random_num(1,4)
new weapon = get_user_weapon(idattacker)
new health = get_user_health(this)
if(!ma_perk[idattacker])
return HAM_IGNORED;
if(ma_perk[idattacker] && liczba==4 && weapon==CSW_DEAGLE){
SetHamParamFloat(4, float(health))
return HAM_HANDLED
}
return HAM_IGNORED
}