Возможно, кому-то пригодится... Как делать не нужно...
Первый вариант вызывает 2 раза
Код:
stock acs_give_item_ex(const id, const weapon[], count = 0, GiveType:type = GT_APPEND) {
static i_entity;
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): id = %d, weapon = %s, count = %d, type = %d", id, weapon, count, type);
if (!is_nullent((i_entity = rg_give_item(id, weapon, type))) && count) {
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): set maxammo = %d", count);
rg_set_iteminfo(i_entity, ItemInfo_iMaxAmmo1, count);
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): set bpammo = %d", count);
rg_set_user_bpammo(id, acs_get_weapon_info(weapon, WI_ID), count);
}
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): end");
}
Код:
stock acs_give_item_ex(const id, const weapon[], count = 0, GiveType:type = GT_APPEND) {
static i_entity;
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): id = %d, weapon = %s, count = %d, type = %d", id, weapon, count, type);
i_entity = rg_give_item(id, weapon, type);
if (!is_nullent(i_entity) && count) {
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): set maxammo = %d", count);
rg_set_iteminfo(i_entity, ItemInfo_iMaxAmmo1, count);
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): set bpammo = %d", count);
rg_set_user_bpammo(id, acs_get_weapon_info(weapon, WI_ID), count);
}
//acs_client_print(id, ACS_SHOW_DEBUG, "give_item_ex(): end");
}
rg_give_item()