呃…我人懒所以解释的不够好…
复制程式
public zp_extra_item_selected(id, itemid)
{
if (itemid == g_item)
{
if (has_item[id])
{
client_print(id, print_center, "你已经拥有此武器")
return;
}
has_item[id] = 1
set_money(id, get_money(id) - cv_num(cvar_cost))
if (has_weapon(id, 1)) drop_weapons(id, 1)
fm_give_item(id, wpn_class[CHANGE_WEAPON])
new weapon = fm_find_ent_by_owner(-1, wpn_class[CHANGE_WEAPON], id)
cs_set_weapon_ammo(weapon, cv_num(cvar_clip))
cs_set_user_bpammo(id, CHANGE_WEAPON, cv_num(cvar_bpammo))
client_print(id, print_chat, "你购买了%s", new_wpn)
}
}