Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-06-2010 , 15:41   Ham_TakeDamage problem
Reply With Quote #1

PHP Code:
public _Ham_TakeDamage(id,Inflictor,Attacker,Float:Damage,DamageBits)
{
    if(
get_pcvar_num(p_On) && is_user_alive(id) && is_user_alive(Attacker) && (g_Countdown[id] > || (g_Dueling[id] != Attacker && g_Dueling[id]) || (!g_Dueling[id] && g_Dueling[Attacker]) || (get_pcvar_num(p_OnlyDuel) && !g_Dueling[id] && !g_Dueling[Attacker])))
        
SetHamParamFloat(4,0.0)
    
    
    if(
g_Dueling[id] && g_Dueling[Attacker])
    {
        new 
health get_user_healthid )
        if ( (
health Damage) < )
        {
            
set_user_health(id1)
            
            
            new 
Other g_Dueling[id]
            
g_Dueling[id] = 0
            g_Dueling
[Other] = 0
            
            
new NameAtt[32], NameVic[32]
            
get_user_name(AttackerNameAtt31)
            
get_user_name(idNameVic31)
            
            
            
Render(id,0,Float:{255.0,255.0,255.0})
            
            
ForwardPlayerPostThink(id)
            
            new 
Health get_user_health(Attacker)
            
client_print(id,print_chat,"[ARP] %s te porazil v duelu s %d zbyvajicimi zivoty.",NameAtt,Health)
            
client_print(Attacker,print_chat,"[ARP] Porazil jsi %s se %d zbyvajicimi zivoty.",NameVic,Health)
            
            
client_cmd(Attacker"say /me porazil %s v duelu!"NameVic)
            
            
Render(Attacker,0,Float:{255.0,255.0,255.0})
    
        }
        
    }

return 
HAM_IGNORED

Why the code above always blocks any damage? I don't know how to work with returns in HamSandwich, but I think it's caused by them.
Backstabnoob is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-06-2010 , 16:16   Re: Ham_TakeDamage problem
Reply With Quote #2

this blocks all the damage done.
It changes the 4th parameter to 0.0, which in Float: Damage in this case
PHP Code:
SetHamParamFloat(4,0.0
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-06-2010 , 16:22   Re: Ham_TakeDamage problem
Reply With Quote #3

No, that if() is completely right and I'm pretty sure.
Backstabnoob is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-06-2010 , 16:35   Re: Ham_TakeDamage problem
Reply With Quote #4

fixed that already.
Backstabnoob is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-06-2010 , 16:44   Re: Ham_TakeDamage problem
Reply With Quote #5

I don't see anything else that could cause the problem
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 05:22.


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