找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 769|回复: 8

[已解决] 求助:插件出问题了!

[复制链接]

该用户从未签到

发表于 2011-5-1 13:24:22 | 显示全部楼层 |阅读模式
我用的是SIMEN1.8的跳跃插件,可是我跳图中发现mpbhop.amxx(就是箱子不下沉的插件)出问题了,箱子的确没沉,不过直接将箱子变成了一个固体block,人都可以站在上面,求解决!

该用户从未签到

发表于 2011-5-1 13:44:58 | 显示全部楼层

  1. Description:
  2. This plugin allows clients to jump across sections of bhops without the blocks being triggered.  The blocks stay in place all the time making it much more suitable for multiplayer.  It is also semiclip safe.
  3. See it in Action:
  4. 1337bunnies server: 66.55.131.63:27015
  5. Commands:
  6. Not Applicable.

  7. Cvars:
  8. mpbhops <0|1> Disables/enables bhop handling.

  9. Requirements:
  10. Engine module

  11. Notes:
  12. This is a stand alone version of the code from my climb plugin, for those who don't want all the features it offers.
  13. http://ian.cammarata.us/projects/climb

  14. Credits:
  15. Thanks to Lola for letting me use her awesome server for testing purposes.
  16. http://1337bunnies.com
  17. 66.55.131.63:27015
  18. Thanks to r33d and Woofie for testing.

  19. Supported Languages:
  20. Not Applicable.

  21. Change Log:
  22. Key (+ added | - removed | c changed | f fixed)
  23. v1.2 (SEPT 23, 2007)
  24. +: Semiclip support for BCM plugins by Emp` and Necro.
  25. v1.1 (SEPT 23, 2007)
  26. c: Increased fail check time from 0.1 seconds to 0.2 seconds.  Should fix some people getting fail when doing a standupbhop.
  27. f: Teleporting to world origin rarely when hopping back and forth between func_door and world brush.
  28. f: Touch is detected even when clients aren't solid. (No more semiclip exploit)
  29. v1.0 (SEPT 21, 2007)
  30. !: Initial release
  31. */
  32. #include <amxmodx>
  33. #include <engine>
  34. #include <fakemeta>
  35. #define VERSION "1.2"
  36. #define MAX_DOORS 500
  37. #define TSK_BHOP 50
  38. #define TSK_CLEAR_FAIL 100
  39. //func_doors[x]{ id, speed, angles }
  40. new door_count = 0, func_doors[MAX_DOORS][3], Float:door_tp_pos[MAX_DOORS][3]
  41. new bhop_failid[32], bool:bhop_fail[32]
  42. new p_enabled
  43. new MAXPLAYERS
  44. public plugin_init( )
  45. {
  46. MAXPLAYERS = get_maxplayers( )

  47. register_plugin( "MP Bhops", VERSION, "Ian Cammarata" )
  48. register_cvar( "mpbhops_version", VERSION, FCVAR_SERVER )

  49. p_enabled = register_cvar( "mpbhops", "0", FCVAR_SERVER )
  50. }
  51. public pfn_keyvalue( ent )
  52. {
  53. static last_ent
  54. new class[31], key[31], val[31]
  55. copy_keyvalue( class, 30, key, 30, val, 30 )

  56. if( ent != last_ent && func_doors[door_count][0] && door_count < MAX_DOORS )
  57.   door_count++

  58. if( equal( class, "func_door" ) )
  59. {  
  60.   if( ent != last_ent ) func_doors[door_count][0] = ent
  61.   if( equal( key, "speed" ) )
  62.    func_doors[door_count][1] = str_to_num(val)
  63.   if( equal( key, "dmg" ) )
  64.    func_doors[door_count][0] = 0
  65.   if( equal( key, "angles" ) )
  66.   {
  67.    new angles[5]
  68.    parse( val, angles, 4 )
  69.    func_doors[door_count][2] = str_to_num( angles )
  70.   }
  71.   last_ent = ent
  72. }

  73. return PLUGIN_CONTINUE
  74. }
  75. public plugin_cfg( )
  76. {
  77. if( func_doors[door_count][0] && door_count < MAX_DOORS )
  78.   door_count++

  79. new ent, ent2, tmpstr[33]
  80. new Float:dmins[3], Float:dmaxs[3]

  81. //Find tp spots for doors, in case they're used for bhop
  82. for( new i = 0; i < door_count; i++ )
  83. {
  84.   ent = func_doors[i][0]
  85.   if( !is_valid_ent( ent ) ) func_doors[i][0] = 0
  86.   else
  87.   {
  88.    entity_get_vector( ent, EV_VEC_mins, dmins )
  89.    entity_get_vector( ent, EV_VEC_maxs, dmaxs )
  90.    
  91.    new dwid = floatround( dmaxs[0] - dmins[0] )
  92.    new dlen = floatround( dmaxs[1] - dmins[1] )
  93.    
  94.    //If the door moves up, or is thin, remove it's id from the array
  95.    if( func_doors[i][2] < 0 || dwid < 24 || dlen < 24 )
  96.     func_doors[i][0] = 0
  97.    //Otherwise find a safe tp spot in case it's a bhop door
  98.    else
  99.    {
  100.     //If it has a targetname, change the id in array to targeter
  101.     entity_get_string( ent, EV_SZ_targetname, tmpstr, 32 )
  102.     if( strlen( tmpstr ) )
  103.     {
  104.      ent2 = find_ent_by_target( -1, tmpstr )
  105.      if( ent2 )
  106.      {
  107.       func_doors[i][0] = ent2
  108.       
  109.       //If targeter is a button, remove it's id from the array
  110.       entity_get_string( ent2, EV_SZ_classname, tmpstr, 32 )
  111.       if( equal( tmpstr, "func_button" ) )
  112.        func_doors[i][0] = 0
  113.      }
  114.     }
  115.    
  116.     new Float:tmpvec[3], Float:tmpvec2[3]
  117.    
  118.     new Float:dr_tc[3]
  119.     dr_tc[0] = ( dmaxs[0] + dmins[0] ) / 2
  120.     dr_tc[1] = ( dmaxs[1] + dmins[1] ) / 2
  121.     dr_tc[2] = dmaxs[2]  
  122.          
  123.     tmpvec[0] = ( dmaxs[0] + dmins[0] ) / 2
  124.     tmpvec[1] = dmaxs[1] + 20
  125.     tmpvec[2] = dmaxs[2] + 20
  126.     trace_line( ent, dr_tc, tmpvec, tmpvec2 )
  127.     if( !trace_hull( tmpvec, HULL_HUMAN ) && tmpvec2[2] == tmpvec[2] )
  128.      door_tp_pos[i] = tmpvec
  129.     else
  130.     {
  131.      tmpvec[1] = dmins[1] - 20
  132.      trace_line( ent, dr_tc, tmpvec, tmpvec2 )
  133.      if( !trace_hull( tmpvec, HULL_HUMAN ) && tmpvec2[2] == tmpvec[2] )
  134.       door_tp_pos[i] = tmpvec
  135.      else
  136.      {
  137.       tmpvec[0] = dmaxs[0] + 20
  138.       tmpvec[1] = ( dmaxs[1] + dmins[1] ) / 2
  139.       trace_line( ent, dr_tc, tmpvec, tmpvec2 )
  140.       if( !trace_hull( tmpvec, HULL_HUMAN ) && tmpvec2[2] == tmpvec[2] )
  141.        door_tp_pos[i] = tmpvec
  142.       else
  143.       {
  144.        tmpvec[0] = dmins[0] - 20
  145.        door_tp_pos[i] = tmpvec
  146.       }
  147.      }
  148.     }
  149.    }
  150.   }
  151. }
  152. }
  153. //This is a semiclip fix
  154. public client_PreThink( id )
  155. {
  156. //If they're on the ground and not solid...
  157. if( ( pev( id, pev_flags  ) & FL_ONGROUND ) && !pev( id, pev_solid ) )
  158. {
  159.   new Float:orig[3]
  160.   entity_get_vector( id, EV_VEC_origin, orig )
  161.   
  162.   //do a hull trace 1 unit below their origin
  163.   orig[2] -= 1
  164.   engfunc( EngFunc_TraceHull, orig, orig, DONT_IGNORE_MONSTERS, HULL_HUMAN, id, 0 )
  165.   new ent = get_tr2( 0, TR_pHit )
  166.   
  167.   //if all we hit is world or another player, who cares, exit
  168.   if( ent <= MAXPLAYERS ) return PLUGIN_CONTINUE
  169.   
  170.   //if we hit a door in the array, send it to the handler then exit
  171.   new dpos = door_in_array( ent )
  172.   if( dpos > -1 )
  173.   {
  174.    bhop_check_fail( id, ent, dpos )
  175.    return PLUGIN_CONTINUE
  176.   }
  177.   
  178.   //if we hit a BCM entity, force touch so the BCM plugin can handle it
  179.   new class[32]
  180.   entity_get_string( ent, EV_SZ_classname, class, 31 )
  181.   if( equal( class, "bcm" ) || equal( class, "bm_block" ) )
  182.    fake_touch( ent, id )
  183. }

  184. return PLUGIN_CONTINUE
  185. }
  186. public pfn_touch( ent, id )
  187. {
  188. if( !get_pcvar_num( p_enabled ) || !ent || !id )
  189.   return PLUGIN_CONTINUE

  190. //Make sure id is player and ent is object
  191. if( 0 < ent <= MAXPLAYERS )
  192. {
  193.   new tmp = id
  194.   id = ent
  195.   ent = tmp
  196. }
  197. else if( !( 0 < id <= MAXPLAYERS ) )
  198.   return PLUGIN_CONTINUE

  199. //Bhop stuff
  200. new dpos = door_in_array( ent )
  201. if( dpos > -1 )
  202. {
  203.   bhop_check_fail( id, ent, dpos )
  204.   return PLUGIN_HANDLED
  205. }

  206. return PLUGIN_CONTINUE
  207. }
  208. public bhop_check_fail( id, ent, dpos )
  209. {
  210. if( bhop_failid[id-1] != ent )
  211. {
  212.   bhop_failid[id-1] = ent
  213.   bhop_fail[id-1] = false
  214.   
  215.   new tskid = TSK_BHOP + id
  216.   if( task_exists( tskid ) )
  217.    remove_task( tskid )
  218.   set_task( 0.2, "bhop_set_fail", tskid )
  219.   tskid = TSK_CLEAR_FAIL + id
  220.   if( task_exists( tskid ) )
  221.    remove_task( tskid )
  222.   set_task( 0.7, "bhop_clear_fail", tskid )
  223. }
  224. else if( bhop_fail[id-1] )
  225. {
  226.   //Teleport to fail position
  227.   entity_set_vector( id, EV_VEC_velocity, Float:{0.0, 0.0, 0.0} )
  228.   entity_set_vector( id, EV_VEC_origin, door_tp_pos[dpos] )
  229.   
  230.   //Reset fail vars
  231.   bhop_failid[id-1] = 0
  232.   bhop_fail[id-1] = false
  233. }
  234. }
  235. public door_in_array( door )
  236. {
  237. for( new i = 0; i < door_count; i++ )
  238.   if( func_doors[i][0] == door )
  239.    return i
  240. return -1
  241. }
  242. public bhop_set_fail( tskid )
  243. {
  244. bhop_fail[ tskid - TSK_BHOP - 1 ] = true
  245. return PLUGIN_HANDLED
  246. }
  247. public bhop_clear_fail( tskid )
  248. {
  249. new id = tskid - TSK_CLEAR_FAIL
  250. bhop_failid[id-1] = 0
  251. bhop_fail[id-1] = false
  252. return PLUGIN_HANDLED
  253. }
复制代码

该用户从未签到

发表于 2011-5-1 14:27:47 | 显示全部楼层
插件的问题我还是打酱油走了

该用户从未签到

发表于 2011-5-1 14:29:33 | 显示全部楼层
回复 lzj5911 的帖子

你要是在敢打酱油,你 .....
过来,让我亲一下你的小JJ {:soso_e131:}

点评

亲我的吧  发表于 2011-5-1 17:17

该用户从未签到

发表于 2011-5-1 14:36:36 | 显示全部楼层
因为你有管理员权限吧。。。这个问题还真不好解决

该用户从未签到

发表于 2011-5-1 14:41:02 | 显示全部楼层
回复 SiMen.K. 的帖子

好把,不打了- -

该用户从未签到

发表于 2011-5-1 14:42:52 | 显示全部楼层
回复 fantasist 的帖子

plugins  使用 admin_sql.amxx

该用户从未签到

发表于 2011-5-1 15:44:08 | 显示全部楼层
你是完成地图后 或就没有按计时器造成的问题。

该用户从未签到

发表于 2011-5-2 07:42:53 | 显示全部楼层
回复 SiMen.K. 的帖子

不如替换一个原版的mpbhop插件
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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