cs_set_weapon_ammo ( index, 1 ), where index is the index of the entity, not player.
So you have first to get the index of "your" m4a1.
http://www.amxmodx.org/funcwiki.php?go=func&id=208
So for a m4a1 for example :
new entity_index = fm_get_user_weapon_entity(id, CSW_M4A1)
cs_set_weapon_ammo (entity_index, 1 )
Open fakemeta_util to see fm_get_user_weapon_entity source code