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


new const perk_name[] = "Plecak";
new const perk_desc[] = "Dostajesz 400 Arrmoru, Defuse i paczke granatow.";

new bool:ma_perk[33];
new CsArmorType:ArmorType

public plugin_init()
{
	register_plugin(perk_name, "1.0", "Play");
	
	cod_register_perk(perk_name, perk_desc);
}
public cod_perk_enabled(id)
{
	cod_give_weapon(id, CSW_HEGRENADE);
	cod_give_weapon(id, CSW_FLASHBANG);
	cod_give_weapon(id, CSW_SMOKEGRENADE);
	if (cs_get_user_armor(id, ArmorType)==0)
		cs_set_user_armor(id, 400, CS_ARMOR_VESTHELM) 
	cs_set_user_defuse(id, 1);
	ma_perk[id] = true;
	return COD_CONTINUE;
}

public cod_perk_disabled(id)
{
	cod_take_weapon(id, CSW_HEGRENADE);
	cod_take_weapon(id, CSW_FLASHBANG);
	cod_take_weapon(id, CSW_SMOKEGRENADE);	
	cs_set_user_armor(id, 0, CS_ARMOR_NONE);
	cs_set_user_defuse(id, 1);
	ma_perk[id] = false;	
}