Quote:
Originally Posted by ish12321
That way I get weaponbox but I want the name of weapon ,i.e., something link weapon_ak47 or. ...
So is that possible ?
|
Sorry. You need to loop all slots from the box to get the weapon entity, after that you can use pev_classname on it and get what you need.
PHP Code:
RetrieveWeapon(WeaponBoxEntity)
{
const XoWeapon = 4
new const m_rgpPlayerItems_CWeaponBox[6] = {34, 35, ...}
new WeaponEntity
for(new i = 1; i< sizeof m_rgpPlayerItems_CWeaponBox; i++)
{
WeaponEntity = get_pdata_cbase(WeaponBoxEntity, m_rgpPlayerItems_CWeaponBox[i], XoWeapon)
if(pev_valid(WeaponEntity))
{
break
}
}
return WeaponEntity
}
Use this stock, it returns the weapon entity index that's inside the weaponbox.
__________________