Raised This Month: $32 Target: $400
 8% 

Proper way to deal damage without extensions


Post New Thread Reply   
 
Thread Tools Display Modes
necavi
Veteran Member
Join Date: Sep 2010
Old 07-01-2013 , 02:24   Re: Proper way to deal damage without extensions
Reply With Quote #51

What you should do to merely increase damage is use a TakeDamage hook or something similar and multiply the damage in place, that'll prevent retriggering.
necavi is offline
Sansaurithbane
Junior Member
Join Date: Jun 2013
Old 07-05-2013 , 22:47   Re: Proper way to deal damage without extensions
Reply With Quote #52

Quote:
Originally Posted by Powerlord View Post
You're setting the inflicator and weapon arguments to the weapon's entity index like psychonic mentioned? (I don't think CS:S supports the weapon argument)
It appears you are correct, in CS:S it shows up as a suicide message. In CSGO it seemed like if the added damage killed the victim, it would show it as a suicide and the attacker killed the victim with whatever weapon was used.

And it seemed like the event didn't re-trigger the damage.

Last edited by Sansaurithbane; 07-05-2013 at 22:47.
Sansaurithbane is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-14-2017 , 17:30   Re: Proper way to deal damage without extensions
Reply With Quote #53

Nem syntax:

PHP Code:
stock void DealDamage(int nClientVictimint nDamageint nClientAttacker 0int nDamageType DMG_GENERICchar[] sWeapon "")
// ----------------------------------------------------------------------------
{
    
// taken from: http://forums.alliedmods.net/showthread.php?t=111684
    // thanks to the authors!
    
if(    nClientVictim &&
            
IsValidEdict(nClientVictim) &&
            
IsClientInGame(nClientVictim) &&
            
IsPlayerAlive(nClientVictim) &&
            
nDamage 0)
    {
        
int EntityPointHurt CreateEntityByName("point_hurt");
        if(
EntityPointHurt != 0)
        {
            
char sDamage[16];
            
IntToString(nDamagesDamagesizeof(sDamage));

            
char sDamageType[32];
            
IntToString(nDamageTypesDamageTypesizeof(sDamageType));

            
DispatchKeyValue(nClientVictim,            "targetname",        "war3_hurtme");
            
DispatchKeyValue(EntityPointHurt,        "DamageTarget",    "war3_hurtme");
            
DispatchKeyValue(EntityPointHurt,        "Damage",                sDamage);
            
DispatchKeyValue(EntityPointHurt,        "DamageType",        sDamageType);
            if(!
StrEqual(sWeapon""))
                
DispatchKeyValue(EntityPointHurt,    "classname",        sWeapon);
            
DispatchSpawn(EntityPointHurt);
            
AcceptEntityInput(EntityPointHurt,    "Hurt",                    (nClientAttacker != 0) ? nClientAttacker : -1);
            
DispatchKeyValue(EntityPointHurt,        "classname",        "point_hurt");
            
DispatchKeyValue(nClientVictim,            "targetname",        "war3_donthurtme");

            
RemoveEdict(EntityPointHurt);
        }
    }

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
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 23:49.


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