Raised This Month: $ Target: $400
 0% 

Float problem with Ham_TakeDamage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 06-19-2011 , 07:18   Float problem with Ham_TakeDamage
Reply With Quote #1

Alright, I am still not that friendly with floats.
Are the parameters right at all? The main problem is in "fm_set_user_health".

PHP Code:
public Ham_CBasePlayer_TakeDamage_Post(idpevInflictorpevAttackerFloat:flDamagebitsDamageType)
{
    if(
IsPlayer(pevAttacker) && is_user_connected(pevAttacker) && HasUserMirror(id) && id != pevAttacker)
    {
            new 
Float:damage_done Float:flDamage get_pcvar_num(md_hp_division)
        
            new 
Float:HP get_user_health(pevAttacker) - Float:damage_done
            
            
if(Float:HP 5.0)
            {
                
fm_set_user_health(pevAttackerfm_get_user_health(pevAttacker) - Float:damage_done)
                
fade_red(pevAttackerget_pcvar_num(md_fade_amount))
            }
    }
}

stock fm_set_user_health(idhealth)
{
    
health set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid)
    return 
1
}

stock fm_get_user_health(id)
{
    return 
pev(idpev_health)

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu 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 23:26.


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