HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <zombieplague>
  4.  
  5. new g_zclass_bhzombie
  6. new g_hasBhop[33], bool:g_restorevel[33], Float:g_velocity[33][3]
  7.  
  8. new const zclass_name[] = { "BunnyHop Zombi" }
  9. new const zclass_info[] = { "Nyúlugrás" }
  10. new const zclass_model[] = { "zombie_source" }
  11. new const zclass_clawmodel[] = { "v_knfie_zombie.mdl" }
  12. const zclass_health = 4750
  13. const zclass_speed = 220
  14. const Float:zclass_gravity = 1.0
  15. const Float:zclass_knockback = 1.0
  16.  
  17. public plugin_init()
  18. {
  19. register_plugin("[ZP] Class : BunnyHop Zombie", "1.2", "fa†es™, fix LARS-BLOODLIKER")
  20.  
  21. register_event( "DeathMsg", "event_player_death", "a" )
  22.  
  23. register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
  24. register_forward(FM_PlayerPreThink, "fw_PlayerPreThink_Post", 1)
  25. }
  26.  
  27. public plugin_precache()
  28. {
  29. g_zclass_bhzombie = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
  30. }
  31.  
  32. public zp_user_infected_post(id, infector)
  33. {
  34. if (zp_get_user_zombie_class(id) == g_zclass_bhzombie)
  35. {
  36. g_hasBhop[ id ] = true
  37.  
  38. pev(id, pev_velocity, g_velocity[id])
  39. }
  40. }
  41.  
  42. public client_connect( id )
  43. {
  44. g_hasBhop[ id ] = false
  45. }
  46.  
  47. public client_disconnect( id )
  48. {
  49. g_hasBhop[ id ] = false
  50. }
  51.  
  52. public event_player_death()
  53. {
  54. g_hasBhop[ read_data( 2 ) ] = false
  55. }
  56.  
  57. public fw_PlayerPreThink(id)
  58. {
  59. if(!is_user_alive(id) || !zp_get_user_zombie(id))
  60. {
  61. return FMRES_IGNORED
  62. }
  63.  
  64. if (zp_get_user_zombie_class(id) != g_zclass_bhzombie)
  65. {
  66. return FMRES_IGNORED
  67. }
  68.  
  69. set_pev( id, pev_fuser2, 0.0 )
  70.  
  71. if( pev( id, pev_button ) & IN_JUMP )
  72. {
  73. new szFlags = pev( id, pev_flags )
  74.  
  75. if( !( szFlags & FL_WATERJUMP ) && pev( id, pev_waterlevel ) < 2 && szFlags & FL_ONGROUND )
  76. {
  77. new Float: szVelocity[ 3 ]
  78. pev( id, pev_velocity, szVelocity)
  79. szVelocity[ 2 ] += 250.0
  80. set_pev( id, pev_velocity, szVelocity )
  81. set_pev( id, pev_gaitsequence, 6 )
  82. }
  83. }
  84.  
  85. if (pev(id, pev_flags) & FL_ONGROUND)
  86. {
  87. pev(id, pev_velocity, g_velocity[id])
  88.  
  89. g_restorevel[id] = true
  90. }
  91.  
  92. return FMRES_IGNORED
  93. }
  94.  
  95. public fw_PlayerPreThink_Post(id)
  96. {
  97. if (zp_get_user_zombie_class(id) != g_zclass_bhzombie)
  98. {
  99. return FMRES_IGNORED
  100. }
  101.  
  102. if (g_restorevel[id])
  103. {
  104. g_restorevel[id] = false
  105.  
  106. if (!(pev(id, pev_flags) & FL_ONTRAIN))
  107. {
  108. new groundent = pev(id, pev_groundentity)
  109.  
  110. if (pev_valid(groundent) && (pev(groundent, pev_flags) & FL_CONVEYOR))
  111. {
  112. static Float:vecTemp[3]
  113.  
  114. pev(id, pev_basevelocity, vecTemp)
  115.  
  116. g_velocity[id][0] += vecTemp[0]
  117. g_velocity[id][1] += vecTemp[1]
  118. g_velocity[id][2] += vecTemp[2]
  119. }
  120.  
  121. set_pev(id, pev_velocity, g_velocity[id])
  122.  
  123. return FMRES_HANDLED
  124. }
  125. }
  126.  
  127. return FMRES_IGNORED
  128. }