Can you help me to add "unlimited clip: no/yes"(if the player who i spectate is bought unlimited clip it should be yes, if he don't bought it should be no) iin spectating hud? That is the spectating hud code:
// Player buys our upgrade, set the unlimited ammo flag public zp_extra_item_selected(player, itemid) { if (itemid == g_itemid_infammo) g_has_unlimited_clip[player] = true }
// Reset flags for all players on newround public event_round_start() { for (new id; id <= 32; id++) g_has_unlimited_clip[id] = false; }
// Unlimited clip code public message_cur_weapon(msg_id, msg_dest, msg_entity) { // Player doesn't have the unlimited clip upgrade if (!g_has_unlimited_clip[msg_entity]) return;
// Player not alive or not an active weapon if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1) return;
static weapon, clip weapon = get_msg_arg_int(2) // get weapon ID clip = get_msg_arg_int(3) // get weapon clip
// Unlimited Clip Ammo if (MAXCLIP[weapon] > 2) // skip grenades { set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
if (clip < 2) // refill when clip is nearly empty { // Get the weapon entity static wname[32], weapon_ent get_weaponname(weapon, wname, sizeof wname - 1) weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
// Set max clip on weapon fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon]) } } }
// Find entity by its owner (from fakemeta_util) stock fm_find_ent_by_owner(entity, const classname[], owner) { while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
return entity; }
// Set Weapon Clip Ammo stock fm_set_weapon_ammo(entity, amount) { set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS); } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par } */