#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new CSW_MAXAMMO[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100, -1, -1}

public plugin_init()
{

	register_plugin("UnlimitedAmmo", "1.0", "Play")
		
	register_event("CurWeapon","event_curweapon","be", "1=1");
	
}
public event_curweapon(id)
{
	if(!is_user_alive(id))
		return PLUGIN_CONTINUE;
	
	new weaponID= read_data(2)
	if(weaponID == CSW_C4 || weaponID==CSW_KNIFE || weaponID == CSW_HEGRENADE || weaponID == CSW_SMOKEGRENADE || weaponID == CSW_FLASHBANG)
		return PLUGIN_CONTINUE;
	
	if(cs_get_user_bpammo(id, weaponID)!=CSW_MAXAMMO[weaponID])
		cs_set_user_bpammo(id, weaponID, CSW_MAXAMMO[weaponID])
	
	return PLUGIN_CONTINUE;
}
