/*================================================================================
--------------------------------------------
-*- [ZP] Zombie Class: Faller Zombie 1.0 -*-
--------------------------------------------
~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~
This zombie doesn't take any damage from falls.
================================================================================*/
#include <amxmodx>
#include <hamsandwich>
#include <hlsdk_const>
#include <zombieplague>
/*================================================================================
[Plugin Customization]
=================================================================================*/
// Faller Zombie Attributes
new const zclass_name[] = { "Ellenalo Zombi" }
new const zclass_info[] = { "Ellenal az eseseknek" }
new const zclass_model[] = { "zombie_source" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 2300
const zclass_speed = 230
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
/*============================================================================*/
// Class ID
new g_zclass_faller
// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
register_plugin("[ZP] Class: Faller Zombie", "1.0", "MeRcyLeZZ")
// Register the new class and store ID for reference
g_zclass_faller = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
// Forwards
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
}
// Ham Player Take Damage forward
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Victim is not taking damage from a fall
if (!(damage_type & DMG_FALL))
return HAM_IGNORED;
// Victim is not a faller zombie
if (!zp_get_user_zombie(victim) || zp_get_user_zombie_class(victim) != g_zclass_faller)
return HAM_IGNORED;
// Block the falling damage
return HAM_SUPERCEDE;
}