hl_user_has_weapon

Signature
stock hl_user_has_weapon(id, weapon_id){ new ent; for(new i = 1; i < HL_MAX_WEAPON_SLOTS; i++) { ent = get_ent_data_entity(id, "CBasePlayer", "m_rgpPlayerItems", i); while(ent != FM_NULLENT) { if(hl_get_weapon_id(ent) == weapon_id) return ent; ent = get_ent_data_entity(ent, "CBasePlayerItem", "m_pNext"); } } return 0;}
Description

Checks if user has that weapon (weapon id is from the HLW enum in hlsdk_const.inc)

Returns the weapon entity index or 0 if weapon wasn't found.

Назад
Верх