a safety stock for such thing since give_item might fail returning weapon entity index.
PHP Code:
stock give_player_weapon(id, const weaponname[], const iClip)
{
new ent_ind = give_item(id, weaponname);
if(ent_ind <= 0) ent_ind = find_ent_by_owner(-1, weaponname, id);
if(pev_valid(ent_ind))
{
cs_set_weapon_ammo(ent_ind, iClip);
}
}
__________________