Raised This Month: $ Target: $400
 0% 

Ham take damage attacker change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 10-14-2013 , 18:08   Ham take damage attacker change
Reply With Quote #1

Hello.
I hooked ham take damage and I want to change who the attacker is.
PHP Code:
public DamageTaken(iVictimiInflictoriAttackerFloat:flDamageiDamageBits)
{
        
SetHamParamFloat(3new_id);

Let's say I want to credit every frag to victim's first damage dealer.

I know it's not possible in that way - gives an error.
Can I do it in quick way or do I have to go through whole fake-damage function which will take a while?

Last edited by Gadzislaw007; 10-14-2013 at 18:10.
Gadzislaw007 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-14-2013 , 18:52   Re: Ham take damage attacker change
Reply With Quote #2

Store the first attacker id in an array. Keep in mind to account for grenade damage aswell.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-15-2013 , 02:50   Re: Ham take damage attacker change
Reply With Quote #3

You shouldn't use SetHamParamFloat for sure.

Try SetHamParamEntity
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 10-15-2013 , 07:18   Re: Ham take damage attacker change
Reply With Quote #4

Thanks! Works perfectly!
Gadzislaw007 is offline
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 18:01.


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