HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*================================================================================
  2.  
  3. --------------------------------------------
  4. -*- [ZP] Zombie Class: Faller Zombie 1.0 -*-
  5. --------------------------------------------
  6.  
  7. ~~~~~~~~~~~~~~~
  8. - Description -
  9. ~~~~~~~~~~~~~~~
  10.  
  11. This zombie doesn't take any damage from falls.
  12.  
  13. ================================================================================*/
  14.  
  15. #include <amxmodx>
  16. #include <hamsandwich>
  17. #include <hlsdk_const>
  18. #include <zombieplague>
  19.  
  20. /*================================================================================
  21.  [Plugin Customization]
  22. =================================================================================*/
  23.  
  24. // Faller Zombie Attributes
  25. new const zclass_name[] = { "Ellenalo Zombi" }
  26. new const zclass_info[] = { "Ellenal az eseseknek" }
  27. new const zclass_model[] = { "zombie_source" }
  28. new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
  29. const zclass_health = 2300
  30. const zclass_speed = 230
  31. const Float:zclass_gravity = 1.0
  32. const Float:zclass_knockback = 1.0
  33.  
  34. /*============================================================================*/
  35.  
  36. // Class ID
  37. new g_zclass_faller
  38.  
  39. // Zombie Classes MUST be registered on plugin_precache
  40. public plugin_precache()
  41. {
  42. register_plugin("[ZP] Class: Faller Zombie", "1.0", "MeRcyLeZZ")
  43.  
  44. // Register the new class and store ID for reference
  45. g_zclass_faller = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
  46.  
  47. // Forwards
  48. RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
  49. }
  50.  
  51. // Ham Player Take Damage forward
  52. public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
  53. {
  54. // Victim is not taking damage from a fall
  55. if (!(damage_type & DMG_FALL))
  56. return HAM_IGNORED;
  57.  
  58. // Victim is not a faller zombie
  59. if (!zp_get_user_zombie(victim) || zp_get_user_zombie_class(victim) != g_zclass_faller)
  60. return HAM_IGNORED;
  61.  
  62. // Block the falling damage
  63. return HAM_SUPERCEDE;
  64. }
  65.