/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <cstrike>

new const perk_name[] = "Bron Amadeusza";
new const perk_desc[] = "Dostajesz M5 i +15dmg 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");
	
}
public cod_perk_enabled(id)
{
	cod_give_weapon(id, CSW_MP5NAVY)
	ma_perk[id] = true
}

public cod_perk_disabled(id)
{
	cod_take_weapon(id, CSW_MP5NAVY)
	ma_perk[id] = false
}

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	new weapon = get_user_weapon(idattacker)
	
	if(!is_user_connected(idattacker))
		return HAM_IGNORED;

	if(!ma_perk[idattacker])
		return HAM_IGNORED;
		
	if(ma_perk[idattacker] && weapon==CSW_AUG){
		SetHamParamFloat(3, damage+15.0)
		return HAM_HANDLED
	}
		
	return HAM_IGNORED
}
