找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 454|回复: 2

跪求KZ插件~

[复制链接]

该用户从未签到

发表于 2009-10-21 19:43:03 | 显示全部楼层 |阅读模式
跪求武器落地自动消失的插件,有大虾帮助的祝:秒进钞票日进金。

该用户从未签到

发表于 2009-10-22 10:24:24 | 显示全部楼层
本帖最后由 dsm635625 于 2009-10-22 10:30 编辑

forbid_weapon_drop.amxx
点击进入下载-forbid_weapon_drop.rar



  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #if AMXX_VERSION_NUM >= 180
  4. #include <hamsandwich>
  5. #endif
  6. #pragma semicolon 1
  7. new g_iCvar[3];
  8. public plugin_init( )
  9. {
  10. register_plugin( "Forbid Weapon Drop", "1.3c", "SchlumPF*" );
  11.   
  12. g_iCvar[0] = register_cvar( "drop_allow", "1" );
  13. g_iCvar[1] = register_cvar( "drop_delay", "0.03" );
  14. #if AMXX_VERSION_NUM < 180
  15.   g_iCvar[2] = register_cvar( "drop_remove", "1" );
  16. #else
  17.   g_iCvar[2] = register_cvar( "drop_remove", "2" );
  18. #endif
  19. register_forward( FM_Touch, "fwdTouch" );
  20. register_forward( FM_SetModel, "fwdSetModel" );
  21. #if AMXX_VERSION_NUM >= 180
  22.   RegisterHam( Ham_Spawn, "weaponbox", "hamSpawnWeaponboxPost", 1 );
  23. #endif
  24. }
  25. public client_command( plr )
  26. {
  27. if( !get_pcvar_num( g_iCvar[0] ) )
  28. {
  29.   static command[8];
  30.   read_argv( 0, command, sizeof command - 1 );
  31.   if( equali( command, "drop" ) )
  32.    return PLUGIN_HANDLED;
  33. }

  34. return PLUGIN_CONTINUE;
  35. }
  36. public fwdTouch( toucher, touched )
  37. {
  38. static classname[16];
  39. pev( touched, pev_classname, classname, sizeof classname - 1 );

  40. if( equal( classname, "weaponbox" ) )
  41.   return FMRES_SUPERCEDE;
  42. else
  43. {
  44.   pev( toucher, pev_classname, classname, sizeof classname - 1 );
  45.   
  46.   if( equal( classname, "weaponbox" ) )
  47.    return FMRES_SUPERCEDE;
  48. }

  49. return FMRES_IGNORED;
  50. }
  51. public fwdSetModel( ent )
  52. {
  53.   #if AMXX_VERSION_NUM < 180
  54.    if( get_pcvar_num( g_iCvar[2] ) )
  55.   #else
  56.    if( get_pcvar_num( g_iCvar[2] ) == 1 )
  57.   #endif
  58.   {
  59.    if( pev_valid( ent ) )
  60.    {
  61.     static classname[32];
  62.     pev( ent, pev_classname, classname, sizeof classname -1 );
  63.    
  64.     if( equali( classname, "weaponbox" ) )
  65.      set_task( get_pcvar_float( g_iCvar[1] ), "tskRemoveWeaponbox", ent );
  66.    }
  67.   }
  68. }
  69. #if AMXX_VERSION_NUM == 180
  70. public hamSpawnWeaponboxPost( ent )
  71. {
  72.   if( get_pcvar_num( g_iCvar[2] ) == 2 )
  73.    set_task( get_pcvar_float( g_iCvar[1] ), "tskRemoveWeaponbox", ent );
  74.         
  75.   return HAM_IGNORED;
  76. }
  77. #endif
  78. public tskRemoveWeaponbox( ent )
  79. {
  80. if( pev_valid( ent ) )
  81. {
  82.   engfunc( EngFunc_RemoveEntity, ent );
  83. }
  84. }

复制代码

评分

参与人数 1金币 +1 +1 收起 理由
SiMen.Nathan + 1 + 1 好东东

查看全部评分

该用户从未签到

发表于 2009-10-22 17:50:31 | 显示全部楼层
ls好东西!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表