Raised This Month: $ Target: $400
 0% 

[TF2] Boosting fire damage; SDKHooks documentation


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alfonso Crawford
Member
Join Date: Feb 2012
Old 07-19-2013 , 14:46   Re: [TF2] Boosting fire damage; SDKHooks documentation
Reply With Quote #8

You've all been great; but I found that Powerlord's advice was on-point. Here's what I just finished testing:
PHP Code:
public OnClientPutInServer(client) {
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamagePre);
}

public 
Action:OnTakeDamagePre(victim, &attacker, &inflictor, &Float:damage, &damagetype) {
    if(!
GetConVarBool(CvarMasterSwitch)) return Plugin_Continue;

    new 
String:classname[64];
    
GetEntityClassname(inflictorclassnamesizeof(classname));

    if(
StrEqual(classname"tf_weapon_flamethrower")) {
        
// This index maintains which players receive extra damage from fire.
        // Even with mini-crits, afterburn never goes above 4 points of damage.
        
new Float:threshold 4.0 DamageModifiers[victim];
        if(
damage thresholddamage *= GetConVarFloat(CvarFlameBoost);
        return 
Plugin_Changed;
    }
    else if(
TF2_IsPlayerInCondition(attackerTFCond_OnFire)) {
        
damage *= GetConVarFloat(CvarDebuff);
        return 
Plugin_Changed;
    }
    else return 
Plugin_Continue;

Again, thank you all for the quick responses! Y'all are great, and I thank you for the additional information that came from your discussion!
Alfonso Crawford 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:28.


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