Raised This Month: $32 Target: $400
 8% 

Solved Knife Damage [ Zombie Mod ]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 09-15-2018 , 05:45   Knife Damage [ Zombie Mod ]
Reply With Quote #1

Tell me how to put that only the people and the survivor inflicted damage on zombies

Did so with the connected includ

PHP Code:
if(HasKnife(iAttacker) && (DamageBit DMG_KNIFE) && zp_get_user_zombie(id) && zp_get_user_nemesis(id)) 
return 
HAM_IGNORED
Or forcibly with ! == !zp_get_user_zombie(id)

Or stop.It's people who have to deal Chainsaw damage to zombies, so
zp_get_user_human (id) ?

Thanks so much

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define KNIFE_DAMAGE        500.0

public plugin_init()
{
    
RegisterHam(Ham_TraceAttack,    "func_breakable",    "HamHook_TraceAttack",     false);
    
RegisterHam(Ham_TraceAttack,    "hostage_entity",    "HamHook_TraceAttack",     false);
    
RegisterHam(Ham_TraceAttack,    "info_target",         "HamHook_TraceAttack",    false);
    
RegisterHam(Ham_TraceAttack,    "player",             "HamHook_TraceAttack",    false);
}

#define DMG_KNIFE     ( DMG_NEVERGIB | DMG_BULLET )

#define HasKnife(%1)  (get_user_weapon(%1) == CSW_KNIFE)

public HamHook_TraceAttack(const iVictim, const iAttacker, const Float:flDamage, const Float:VecDir[3], const iTrace, const DamageBit)
{
    if(!
is_user_connected(iAttacker))
        return 
HAM_IGNORED;
    
    if(
HasKnife(iAttacker) && (DamageBit DMG_KNIFE))
        return 
HAM_IGNORED;
    
    
SetHamParamFloat(3KNIFE_DAMAGE);
    
    return 
HAM_IGNORED;


Last edited by MayroN; 09-16-2018 at 09:38.
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
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 12:35.


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