Raised This Month: $ Target: $400
 0% 

damage event


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 01-28-2007 , 01:14   damage event
Reply With Quote #1

Heres my damage event which works like life steal
PHP Code:
public event_damage_lifesteal(id)
{
    new 
damage read_data(2)
    new 
BodypartWeaponattacker get_user_attacker(idWeaponBodypart)
    
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
PLUGIN_CONTINUE
    
    
new current_hp get_user_health(attacker)
    new 
max_hp get_pcvar_num(zomb_hp)
    new 
life_steal floatround(float(current_hp) + (float(damage)))
    
    if(
g_zombie[attacker])
    {
        if(
current_hp max_hp
        {
            
set_user_health(attackermax_hp)
            } else {
            
current_hp += life_steal 
            
if(current_hp >= max_hp)
            {
                
current_hp max_hp
            
}
            
set_user_health(idcurrent_hp)
        }
    }
    return 
PLUGIN_CONTINUE

I'm trying to get rid of this bug where if your hp is below 90 and you stab then. You get like 140 hp instead of the maximum 100. But when I use this. This has no effect in the game.
__________________
It's a mystery.
Mini_Midget is offline
 


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 00:41.


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