Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
DropWeaponSlot( iPlayer, iSlot )
{
static const m_rpgPlayerItems = 367; // player
static const m_pNext = 42; // weapon_*
static const m_iId = 43; // weapon_*
if( !( 1 <= iSlot <= 2 ) )
{
return 0;
}
new iCount;
new iEntity = get_pdata_cbase( iPlayer, ( m_rpgPlayerItems + iSlot ), 5 );
if( iEntity > 0 )
{
new iNext;
new szWeaponName[ 32 ];
do
{
iNext = get_pdata_cbase( iEntity, m_pNext, 4 );
if( get_weaponname( get_pdata_int( iEntity, m_iId, 4 ), szWeaponName, charsmax( szWeaponName ) ) )
{
engclient_cmd( iPlayer, "drop", szWeaponName );
iCount++;
}
}
while( ( iEntity = iNext ) > 0 );
}
return iCount;
}
__________________