Raised This Month: $ Target: $400
 0% 

Reducing Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alfonso Crawford
Member
Join Date: Feb 2012
Old 12-23-2012 , 11:52   Re: Reducing Damage
Reply With Quote #8

I rebuilt the plugin, because it wasn't firing the way I had written it. I can't tell if my new method is working, exactly, because this new setup somehow disables the hit-noise and damage-display: I can't see the numbers pop up over what I'm shooting, though I'm still doing damage. How do I re-enable broadcasting (which I assume I somehow disabled)?

PHP Code:
HookEvent("player_hurt"TakeDamageHookEventHookMode_Pre);

public 
Action:TakeDamageHook(Handle:event, const String:name[], bool:dontBroadcast) {
    if(!
CvarMasterSwitch) return Plugin_Continue;

    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    new 
damage GetEventInt(event"damageamount");

    if(
TF2_IsPlayerInCondition(attackerTFCond_OnFire)) {
        new 
damage;
        
damage *= 0.8;
        
PrintToChatAll("%d -> %f"ddamage);
        
SetEventInt(event"damageamount"RoundToNearest(damage 0.8));
        return 
Plugin_Changed;
    }
    else return 
Plugin_Continue;


Last edited by Alfonso Crawford; 12-24-2012 at 03:17.
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