Try this:
Edited to kill weaponbox when it hits the ground instead of when it leaves the players hands.
PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <cstrike>
new const Version[] = "0.1";
public plugin_init()
{
register_plugin( "No Weapon Drop" , Version , "ConnorMcLeod/bugsy" );
new class[32], ent;
for(new iId = CSW_P228; iId <= CSW_P90; iId++)
{
if( get_weaponname(iId, class, charsmax(class)) )
{
ent = create_entity(class);
if( ent > 0 )
{
if( 1 <= ExecuteHam(Ham_Item_ItemSlot, ent) <= 2 )
{
RegisterHam(Ham_CS_Item_CanDrop, class, "PrimSec_CanDrop", false);
}
remove_entity(ent);
}
}
}
register_touch( "weaponbox" , "worldspawn" , "WeaponboxWorldTouch" );
}
public PrimSec_CanDrop( iEntity )
{
SetHamReturnInteger( false );
return HAM_SUPERCEDE;
}
public WeaponboxWorldTouch( iWeaponbox , iWorld )
{
if ( GetWeaponBoxWeaponType( iWeaponbox ) != CSW_C4 )
{
call_think( iWeaponbox );
}
}
GetWeaponBoxWeaponType( ent )
{
new weapon;
new const m_rgpPlayerItems_CWeaponBox[ 6 ] = { 34 , 35 , ... };
new const XO_CWEAPONBOX = 4;
for(new i = 1; i<= 5; i++)
{
weapon = get_pdata_cbase( ent , m_rgpPlayerItems_CWeaponBox[ i ] , XO_CWEAPONBOX );
if( weapon > 0 )
{
return cs_get_weapon_id( weapon );
}
}
return 0;
}
__________________