/* Plugin generated by AMXX-Studio */

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



new const perk_name[] = "Likwidator Ammo";
new const perk_desc[] = "Masz 1\LW szans na zabranie ammo wrogowi";

new ma_perk[33]
new thieft_ammo[33] = 0;

public plugin_init() 
{
	register_plugin(perk_name, "1.0", "Play");
	
	cod_register_perk(perk_name, perk_desc, 2, 5);
	
	register_event("Damage", "Damage", "b", "2!=0");
	
}
public cod_perk_enabled(id, wartosc)
{
	ma_perk[id] = true;
	thieft_ammo[id] = wartosc;
}
public cod_perk_disabled(id)
{
	ma_perk[id] = false;
	thieft_ammo[id] = 0;
}
public Damage(id)
{
	new idattacker = get_user_attacker(id);

	if(!is_user_alive(idattacker))
		return;

	if(!ma_perk[idattacker])
		return;

	if(random_num(1, thieft_ammo[id]) != 1)
		return;
	
	cs_set_weapon_ammo(id, 0) //ustaw broni 0 ammo
}