Raised This Month: $12 Target: $400
 3% 

Help / Support Zombies not being immune to damage types.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 05-03-2013 , 03:30   Zombies not being immune to damage types.
Reply With Quote #1

Zombies with this class are taking ignored damage types even though I have set it to ignore... help?

Code:
#include <amxmodx>
#include <hamsandwich>
#include <hlsdk_const>
#include <cs_ham_bots_api> //--- Not sure if bots are immune to the damage types by default... let's just put it here just incase.
#include <zp50_class_zombie>
#include <zp50_grenade_frost>
#include <zp50_grenade_fire>

new const PLUGIN_VERSION[] = "1.0"

new const zombieclass1_name[] = "Anti-Element Zombie"
new const zombieclass1_info[] = "Immune fire/ice/water"
new const zombieclass1_models[][] = { "zombie_source" }
new const zombieclass1_clawmodels[][] = { "models/zombie_plague/v_knife_zombie.mdl" }
const zombieclass1_health = 1875
const Float:zombieclass1_speed = 1.0
const Float:zombieclass1_gravity = 1.0
const Float:zombieclass1_knockback = 0.85

new g_ZombieClassID

public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
}

public plugin_precache()
{
    register_plugin("[ZP] Class: Zombie: Anti-Element", PLUGIN_VERSION, "SyluxLockjaw/Spectralopteryx")
    
    new index
    
    g_ZombieClassID = zp_class_zombie_register(zombieclass1_name, zombieclass1_info, zombieclass1_health, zombieclass1_speed, zombieclass1_gravity)
    zp_class_zombie_register_kb(g_ZombieClassID, zombieclass1_knockback)
    
    for(index = 0; index < sizeof zombieclass1_models; index++)
        zp_class_zombie_register_model(g_ZombieClassID, zombieclass1_models[index])
        
    for(index = 0; index < sizeof zombieclass1_clawmodels; index++)
        zp_class_zombie_register_claw(g_ZombieClassID, zombieclass1_clawmodels[index])
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
    if (!(damage_type & DMG_BURN & DMG_SLOWBURN & DMG_FREEZE & DMG_SLOWFREEZE & DMG_DROWN & DMG_SHOCK))
        return HAM_IGNORED;
    
    if (!zp_core_is_zombie(victim) || zp_class_zombie_get_current(victim) != g_ZombieClassID)
        return HAM_IGNORED;
    
    return HAM_SUPERCEDE;
}

public zp_fw_grenade_frost_pre(player)
{
    if(is_user_alive(player) && zp_class_zombie_get_current(player) == g_ZombieClassID)
        return PLUGIN_HANDLED
        
    return PLUGIN_CONTINUE
}

public zp_fw_grenade_fire_pre(player)
{
    if(is_user_alive(player) && zp_class_zombie_get_current(player) == g_ZombieClassID)
        return PLUGIN_HANDLED
        
    return PLUGIN_CONTINUE
}
SyluxLockjaw100 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 05-03-2013 , 07:57   Re: Zombies not being immune to damage types.
Reply With Quote #2

Yo Najwa Latif,

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if(!
zp_core_is_zombie(victim) || zp_class_zombie_get_current(victim) != g_ZombieClassID) return HAM_IGNORED;
        
    if(
damage_type DMG_BURN || damage_type DMG_SLOWBURN 
    
|| damage_type DMG_FREEZE || damage_type DMG_SLOWFREEZE 
    
|| damage_type DMG_DROWN || damage_type DMG_SHOCK) return HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 05-03-2013 at 08:03.
yokomo is offline
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 05-03-2013 , 22:00   Re: Zombies not being immune to damage types.
Reply With Quote #3

Quote:
Originally Posted by yokomo View Post
Yo Najwa Latif,

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if(!
zp_core_is_zombie(victim) || zp_class_zombie_get_current(victim) != g_ZombieClassID) return HAM_IGNORED;
        
    if(
damage_type DMG_BURN || damage_type DMG_SLOWBURN 
    
|| damage_type DMG_FREEZE || damage_type DMG_SLOWFREEZE 
    
|| damage_type DMG_DROWN || damage_type DMG_SHOCK) return HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;

Thanks bro.
SyluxLockjaw100 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode