Raised This Month: $ Target: $400
 0% 

[HELP] ExecuteHam(Ham_TakeDamage)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-08-2015 , 04:53   [HELP] ExecuteHam(Ham_TakeDamage)
Reply With Quote #1

so i this explosive flare grenade code, but for some reason it doesn't deal damage all the time, even tho the damage is printed in chat

PHP Code:
public flare_explode(entity)
{
    if (!
pev_valid(entity))
    {
        return
    }
    
    static 
Float:origin[3// 
    
pev(entitypev_originorigin)
    
    
create_blast2(origin)
     
    
explode(entityorigin)
     
    static 
attacker;
    
attacker pev(entitypev_owner)
     
    static 
victim
    victim 
= -1
     
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFloat:260.0)) != 0)
    {
        
// Only effect alive humans
        
if (!is_user_alive(victim) || !zp_core_is_zombie(victim) || zp_item_zombie_madness_get(victim))
            continue;
 
        static 
Float:orig[3], Float:dmgFloat:knockback[3]
        
pev(victimpev_originorig)
        
dmg get_pcvar_float(cvar_grenade_damage) - get_distance_f(originorig)
        
knockback[0] = get_pcvar_float(cvar_grenade_knockback) - get_distance_f(originorig) * 0.5
        knockback
[1] = get_pcvar_float(cvar_grenade_knockback) - get_distance_f(originorig) * 0.5
        knockback
[2] = get_pcvar_float(cvar_grenade_knockback) - get_distance_f(originorig) * 0.5
         
        ExecuteHamB
(Ham_TakeDamagevictimentityattackerdmg, (1<<24))
        
set_pev(victimpev_velocityknockback)
        static 
name[32]; get_user_name(victimnamecharsmax(name))
        
zp_colored_print(attacker"Damage to^x04 %s^x01 ::^x04 %0.0f damage"namedmg)
        
    }

    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityentity)
 

Depresie is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 10-27-2015 , 09:28   Re: [HELP] ExecuteHam(Ham_TakeDamage)
Reply With Quote #2

PHP Code:
ExecuteHamB(Ham_TakeDamagevictimentityattackerdmg, (1<<24)) 
#1
Maybe you can try using some other stock code to deal damage to entities ?

#2
Try changing ExecuteHamB to ExecuteHam since using ExecuteHamB doesnt make much sense here as it is going to call all the similar hooks in other plugins as well which might be creating the issue..
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux 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 22:08.


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