HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4. #include <fun>
  5. #include <zombieplague>
  6.  
  7. #define VERSION "1.2"
  8.  
  9. new const zclass_name[] = { "Headcrab" }
  10. new const zclass_info[] = { "Kicsi es gyors" }
  11. new const zclass_model[] = { "headcrabme_t" }
  12. new const zclass_clawmodel[] = { "headcrab_t_knife.mdl" }
  13. const zclass_health = 410
  14. const zclass_speed = 700
  15. const Float:zclass_gravity = 0.65
  16. const Float:zclass_knockback = 2.5
  17.  
  18. new g_zclass_crab
  19. new g_headcrab[33][2]
  20.  
  21. public plugin_precache()
  22. {
  23. g_zclass_crab = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
  24. }
  25. public plugin_init()
  26. {
  27. register_plugin("[ZP] Headcrab zombie", VERSION, "aaarnas")
  28. register_cvar("zp_headcrab_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY)
  29. set_cvar_string("zp_headcrab_version", VERSION)
  30. RegisterHam(Ham_Spawn, "player", "FwdHamPlayerSpawnPost")
  31. RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  32. }
  33. public client_connect(id)
  34. {
  35. g_headcrab[id][0] = false
  36. g_headcrab[id][1] = false
  37. }
  38. public client_disconnect(id)
  39. {
  40. g_headcrab[id][0] = false
  41. g_headcrab[id][1] = false
  42. set_pev(id, pev_bInDuck, 0)
  43. client_cmd(id, "-duck")
  44. }
  45. public FwdHamPlayerSpawnPost(id)
  46. {
  47. if(g_headcrab[id][0]) {
  48. g_headcrab[id][0] = false
  49. set_user_hitzones(0, id, 255)
  50. set_pev(id, pev_bInDuck, 0)
  51. client_cmd(id, "-duck")
  52. }
  53. if(g_headcrab[id][1]) {
  54. set_user_hitzones(0, id, 255)
  55. g_headcrab[id][1] = false
  56. }
  57. }
  58. public fw_PlayerKilled(id)
  59. {
  60. if(g_headcrab[id][0]) {
  61. g_headcrab[id][0] = false
  62. set_user_hitzones(0, id, 255)
  63. client_cmd(id, "cl_forwardspeed 400; cl_backspeed 400; cl_sidespeed 400")
  64. set_pev(id, pev_bInDuck, 0)
  65. client_cmd(id, "-duck")
  66. }
  67. }
  68.  
  69. public zp_user_infect_attempt(id) {
  70.  
  71. if(is_user_bot(id))
  72. zp_set_user_zombie_class(id, 0)
  73. }
  74. public zp_user_infected_post(id, infector, nemesis)
  75. {
  76. if(zp_get_user_zombie_class(id) == g_zclass_crab && !nemesis) {
  77. client_cmd(id, "speak sound/headcrab/hc_headbite")
  78. g_headcrab[id][0] = true
  79. g_headcrab[id][1] = true
  80. client_cmd(id, "cl_forwardspeed 2000; cl_backspeed 2000; cl_sidespeed 2000")
  81. set_pev(id, pev_bInDuck, 1)
  82. console_cmd(id, "+duck")
  83. set_user_hitzones(0, id, 200)
  84. set_user_footsteps(id, 1)
  85. }
  86. else if(zp_get_user_zombie_class(id) == g_zclass_crab) {
  87. g_headcrab[id][0] = false
  88. set_user_hitzones(0, id, 255)
  89. set_pev(id, pev_bInDuck, 0)
  90. client_cmd(id, "-duck")
  91. }
  92. else g_headcrab[id][0] = false
  93. }
  94. public zp_user_humanized_post(id)
  95. {
  96. g_headcrab[id][0] = false
  97. set_user_hitzones(0, id, 255)
  98. client_cmd(id, "cl_forwardspeed 400; cl_backspeed 400; cl_sidespeed 400")
  99. set_pev(id, pev_bInDuck, 0)
  100. client_cmd(id, "-duck")
  101. }
  102. public client_PreThink(id)
  103. {
  104. if(g_headcrab[id][0]) {
  105. set_pev(id, pev_bInDuck, 1)
  106. console_cmd(id, "+duck")
  107. }
  108. }
  109.