Yes, it would be more efficient though not sure it would be worth and best way because you would need to patch in 3 locations : packPlayerItem(), CBasePlayer::DropPlayerItem() and CBasePlayer::DropShield(). You can't just trying replacing some value through all the library, you would need to base from the start of the functions. But none are virtual functions thus you would need to make signatures (at least for windows) and that vs SetModel (for example), the latter would be recommended because much more simple, signatures are not that reliable and the difference in efficiently is trivial.
EDIT : For the fun, here an example :
Code:
#include <amxmodx>
#include <orpheu>
#include <orpheu_memory>
#include <orpheu_advanced>
enum Function { packPlayerItem, DropPlayerItem, DropShield };
public plugin_init()
{
register_plugin( "Dropped Weapons Killer", "1.0.0", "Arkshine" );
patch( packPlayerItem, OrpheuGetFunctionAddress( OrpheuGetFunction( "packPlayerItem" ) ) );
patch( DropPlayerItem, OrpheuGetFunctionAddress( OrpheuGetFunction( "DropPlayerItem", "CBasePlayer" ) ) );
patch( DropShield , OrpheuGetFunctionAddress( OrpheuGetFunction( "DropShield" , "CBasePlayer" ) ) );
}
public plugin_end()
{
patch( packPlayerItem, .undo = true );
patch( DropPlayerItem, .undo = true );
patch( DropShield , .undo = true );
}
patch( const Function:currentFunction, startAddress = 0, const bool:undo = false )
{
const Float:originalValue = 300.0;
const Float:newValue = 0.1;
static SavedAddress[ Function ];
undo ? OrpheuMemorySetAtAddress( SavedAddress[ currentFunction ], "float", 1, originalValue ) :
OrpheuMemoryReplaceAtAddress( startAddress, "float", 1, originalValue, newValue, SavedAddress[ currentFunction ] );
}
Note: Unzip the content in ./amxmodx/ directory.