Raised This Month: $12 Target: $400
 3% 

[L4d2] How to add more damage?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-23-2010 , 00:18   [L4d2] How to add more damage?
Reply With Quote #1

PHP Code:
if(!IsFakeClient(attacker) && !StrEqual(WeaponUsed,"Damge_Add"))
{
      new 
Float:AddDamage dmg*Str[attacker]*Effect_Str;
      
DealDamage(victimAddDamageattackerdmgtype"Damge_Add");
}

DealDamage(victim,Float:damage,attacker=0,dmg_type=0,String:weapon[]="")
{
    if(
IsValidEdict(victim) && damage>0)
    {
        new 
String:dmg_str[16];
        
FloatToString(damage,dmg_str,16);
        new 
String:dmg_type_str[32];
        
IntToString(dmg_type,dmg_type_str,32);
        new 
PointHurt CreateEntityByName("point_hurt");
        if(
PointHurt)
        {
            
DispatchKeyValue(victim,"targetname","dmged_target");
            
DispatchKeyValue(PointHurt,"DamageTarget","dmged_target");
            
DispatchKeyValue(PointHurt,"Damage",dmg_str);
            
DispatchKeyValue(PointHurt,"DamageType",dmg_type_str);
            if(!
StrEqual(weapon,""))
            {
                
DispatchKeyValue(PointHurt,"classname",weapon);
            }
            
DispatchSpawn(PointHurt);
            
AcceptEntityInput(PointHurt,"Hurt",(attacker>0)?attacker:-1);
            
DispatchKeyValue(PointHurt,"classname","point_hurt");
            
DispatchKeyValue(victim,"targetname","nondmged_target");
            
RemoveEdict(PointHurt);
        }
    }

I was using the above code to stimulate that player can add damage to the victim based on their str[attacker] and Effect_str, but this method will create one more hit. Can i just modified the player hurt event without adding one more hit.
P.S: I still want hurt/dead message created! (That's why i use the DealDamage() function)
chu1720 is offline
Send a message via MSN to chu1720
Reply



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:22.


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