- 听众
- 收听
- 积分
- 5632
- 主题
- 回帖
- 0
- 精华
注册时间2005-10-28
最后登录1970-1-1
该用户从未签到
|
发表于 2009-10-22 10:24:24
|
显示全部楼层
本帖最后由 dsm635625 于 2009-10-22 10:30 编辑
forbid_weapon_drop.amxx
点击进入下载-forbid_weapon_drop.rar
- #include <amxmodx>
- #include <fakemeta>
- #if AMXX_VERSION_NUM >= 180
- #include <hamsandwich>
- #endif
- #pragma semicolon 1
- new g_iCvar[3];
- public plugin_init( )
- {
- register_plugin( "Forbid Weapon Drop", "1.3c", "SchlumPF*" );
-
- g_iCvar[0] = register_cvar( "drop_allow", "1" );
- g_iCvar[1] = register_cvar( "drop_delay", "0.03" );
- #if AMXX_VERSION_NUM < 180
- g_iCvar[2] = register_cvar( "drop_remove", "1" );
- #else
- g_iCvar[2] = register_cvar( "drop_remove", "2" );
- #endif
- register_forward( FM_Touch, "fwdTouch" );
- register_forward( FM_SetModel, "fwdSetModel" );
- #if AMXX_VERSION_NUM >= 180
- RegisterHam( Ham_Spawn, "weaponbox", "hamSpawnWeaponboxPost", 1 );
- #endif
- }
- public client_command( plr )
- {
- if( !get_pcvar_num( g_iCvar[0] ) )
- {
- static command[8];
- read_argv( 0, command, sizeof command - 1 );
- if( equali( command, "drop" ) )
- return PLUGIN_HANDLED;
- }
- return PLUGIN_CONTINUE;
- }
- public fwdTouch( toucher, touched )
- {
- static classname[16];
- pev( touched, pev_classname, classname, sizeof classname - 1 );
- if( equal( classname, "weaponbox" ) )
- return FMRES_SUPERCEDE;
- else
- {
- pev( toucher, pev_classname, classname, sizeof classname - 1 );
-
- if( equal( classname, "weaponbox" ) )
- return FMRES_SUPERCEDE;
- }
- return FMRES_IGNORED;
- }
- public fwdSetModel( ent )
- {
- #if AMXX_VERSION_NUM < 180
- if( get_pcvar_num( g_iCvar[2] ) )
- #else
- if( get_pcvar_num( g_iCvar[2] ) == 1 )
- #endif
- {
- if( pev_valid( ent ) )
- {
- static classname[32];
- pev( ent, pev_classname, classname, sizeof classname -1 );
-
- if( equali( classname, "weaponbox" ) )
- set_task( get_pcvar_float( g_iCvar[1] ), "tskRemoveWeaponbox", ent );
- }
- }
- }
- #if AMXX_VERSION_NUM == 180
- public hamSpawnWeaponboxPost( ent )
- {
- if( get_pcvar_num( g_iCvar[2] ) == 2 )
- set_task( get_pcvar_float( g_iCvar[1] ), "tskRemoveWeaponbox", ent );
-
- return HAM_IGNORED;
- }
- #endif
- public tskRemoveWeaponbox( ent )
- {
- if( pev_valid( ent ) )
- {
- engfunc( EngFunc_RemoveEntity, ent );
- }
- }
复制代码 |
评分
-
查看全部评分
|