Raised This Month: $ Target: $400
 0% 

fw_TakeDamage, about armor/health/zombies (Not ZP)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 06-13-2014 , 02:47   Re: fw_TakeDamage, about armor/health/zombies (Not ZP)
Reply With Quote #10

Quote:
Originally Posted by Compidence View Post
You need to reword your question. What do you need help with exactly?

PHP Code:
        // Get victim armor 
        
static Float:armor 
        pev
(Victimpev_armorvaluearmor
         
        
// If he has some, block the infection and reduce armor instead 
        
if (armor 0.0
            { 
            if (
armor damage 0.0
                
set_pev(victimpev_armorvaluearmor damage
            else 
            
cs_set_user_armor(victim0CS_ARMOR_NONE
             
            return 
HAM_SUPERCEDE
             
        }       
        
// Set Zombie 
        
set_user_zombie(VictimAttacker00
Is that part not working? It looks fine to me.
I did it wrong, so i get errors...

Edit: I was tired, and fixed the code, but now i get loose intendtion, even though i have intended it.

PHP Code:
public fw_TakeDamage(VictimInflictorAttackerFloat:DamageDamageType)
    {
    if(!
g_Game_Start)
        return 
HAM_SUPERCEDE
    
if(Victim == Attacker)
        return 
HAM_IGNORED
    
if(!is_user_alive(Attacker))
        return 
HAM_IGNORED
    
    
if(Get_BitVar(g_IsZombieVictim) && !Get_BitVar(g_IsZombieAttacker)) // Human -> Zombie
        
{
        if(
DamageType DMG_HEGRENADESetHamParamFloat(4Damage float(D_GrenadePower))
        else {
            
Damage *= g_fDamageMulti[g_Level[Attacker]]
            
            
// Zombie Victim Evolution Code Here!!!
            
if(g_Level[Victim] < 3)
                {
                
g_Evolution[Victim] += (g_Level[Victim] < 2) ? Damage 2000.0 Damage 1000.0
                UpdateLevelZombie
(Victim0)
            }
            
            
// Set Damage
            
SetHamParamFloat(4Damage)
        }
        } else if(!
Get_BitVar(g_IsZombieVictim) && Get_BitVar(g_IsZombieAttacker)) { // Zombie -> Human
        
if(DamageType DMG_HEGRENADE)
            return 
HAM_SUPERCEDE
        
        
// Get victim armor
        
static Float:armor
        pev
(Victimpev_armorvaluearmor)
        
        
// If he has some, block the infection and reduce armor instead
        
if (armor 0.0)
            {
            if (
armor Damage 0.0)
                
set_pev(Victimpev_armorvaluearmor Damage)
            else
            
cs_set_user_armor(Victim0CS_ARMOR_NONE)
            
            return 
HAM_SUPERCEDE;
        }
        
        
// Set Zombie
        
set_user_zombie(VictimAttacker00)
        
        return 
HAM_SUPERCEDE
    
}
    
    return  
HAM_HANDLED

Edit: It works now!, don't know why i get loose intendtion though. but atleast it works.
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 06-13-2014 at 02:57.
SkumTomteN 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 21:14.


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