Raised This Month: $ Target: $400
 0% 

[HELP] ExecuteHam(Ham_TakeDamage)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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