| ghost95v |
12-11-2014 03:10 |
Droped Weapons remover wich to choose?
Wich is the best and reliable code to use for removing droped weapons ?
this 1 ?
PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
public plugin_init( )
{
RegisterHam( Ham_Think, "weaponbox", "OnThink", 1 );
RegisterHam( Ham_Think, "weapon_shield", "OnThink", 1 );
register_forward( FM_SetModel, "OnSetModel", 1 );
}
public OnThink( iEntity )
engfunc( EngFunc_RemoveEntity, iEntity );
public OnSetModel( iEntity )
{
if( pev_valid( iEntity ) )
{
static szClass[ 32 ];
pev( iEntity, pev_classname, szClass, 31 );
if( equal( szClass, "weaponbox" ) || equal( szClass, "weapon_shield" ) )
set_pev( iEntity, pev_nextthink, get_gametime( ) + 0.1 );
}
}
this 2 ?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Destroy Weapons"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_SetModel, "SetModel")
}
public SetModel(iEnt, szModel[])
{
if( equal(szModel, "models/w_", 9) )
{
if( szModel[9] != 'h' && !equal( szModel[9], "sm", 2 ) && !equal( szModel[9], "fl", 2 ) )
set_pev(iEnt, pev_nextthink, get_gametime() + 10.0)
}
}
and this 3 ?
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
new gMaxClients;
new pCvarTime;
public plugin_init ()
{
register_plugin( "Remove Weaponbox", "1.0.0", "Arkshine" );
pCvarTime = register_cvar( "dw_time", "5" );
RegisterHam( Ham_Touch, "weaponbox", "WeaponBox_Touch", 1 );
gMaxClients = get_maxplayers();
}
public WeaponBox_Touch ( const WeaponBox, const Other )
{
if ( !Other || Other > gMaxClients )
{
set_pev( WeaponBox, pev_nextthink, get_gametime() + get_pcvar_float( pCvarTime ) );
}
}
|