/*================================================================================
----------------------------------------------
-*- [ZP] Klasa Zombie / Kuloodporny Zombie -*-
----------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Otrzymuje obrazenia tylko z pistoletow -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
================================================================================*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#define DMG_BULLET (1<<1)
new const zclass_name[] = "ML_KULOODPORNY"
new const zclass_info[] = "ML_KULOODPORNY_INFO"
new const zclass_model[] = "zp_kuloodporny"
new const zclass_clawmodel[] = "v_szklyrece.mdl"
const zclass_health = 1500
const zclass_speed = 190
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
new g_zmpistolshot
public plugin_init()
{
register_plugin("[ZP] Klasa Zombie - obrazenia wylacznie z pistoletow", "0.0.3", "Dr@goN")
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}
public plugin_precache()
g_zmpistolshot = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if (!is_user_alive(this) || !zp_get_user_zombie(this) || zp_get_user_nemesis(this))
return HAM_IGNORED
if(!is_user_connected(idattacker))
return HAM_IGNORED
if (zp_get_user_zombie_class(this) != g_zmpistolshot)
return HAM_IGNORED
if(!(damagebits & DMG_BULLET))
return HAM_IGNORED;
new weapon = get_user_weapon(idattacker);
if(weapon != CSW_SCOUT && weapon != CSW_XM1014 && weapon != CSW_MAC10 && weapon != CSW_AUG && weapon != CSW_UMP45 && weapon != CSW_SG550 && weapon != CSW_GALIL && weapon != CSW_FAMAS && weapon != CSW_AWP && weapon != CSW_MP5NAVY && weapon != CSW_M249 && weapon != CSW_M4A1 && weapon != CSW_TMP && weapon != CSW_G3SG1 && weapon != CSW_SG552 && weapon != CSW_AK47 && weapon != CSW_P90)
return HAM_IGNORED
SetHamParamFloat(4, 0.0)
return HAM_SUPERCEDE
}