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

Proper Friendly Fire


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-28-2011 , 11:22   Proper Friendly Fire
Reply With Quote #1

Ok, this is really starting to annoy me. I can't figure out how to make team attack / friendly fire work properly. By properly I mean like it would in a deathmatch, so attacking players who are supposedly on your team ( Ct attacking a Ct ), will do just as much damage as attacking an enemy ( Ct attack a T ).

First thing I've done is turned friendly fire on.
I want each hit to do 10 damage.

PHP Code:
RegisterHamHam_TakeDamage"player""hamTakeDamage" );

public 
hamTakeDamageVictimInflictorAttackerFloat:DamageDamagebits )

I'm not exactly sure how I'm supposed to work it or what to return in the hook. I've played around with SetHamParamFloat() and a couple of other things and returns, but I'm still ending up with the "friendly fire" effect damage.

Please help me out. Thanks!
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-28-2011 , 11:28   Re: Proper Friendly Fire
Reply With Quote #2

There is check inside TakeDamage if you are the same team, the damage is lowered by 0.35. To remove that, either you would need to make some memory patches (like does CSDM) or you use the trick seen in a plugin (don't remember the name) where you set the victim's team the same as attacker's team in pre, and as post you set back.
__________________
Arkshine is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-28-2011 , 11:28   Re: Proper Friendly Fire
Reply With Quote #3

There's a plugin that does this, it temporairly changes team before damage and restores it after damage... it also prevents loosing money or frags.

http://forums.alliedmods.net/showthread.php?p=711129

EDIT: that memory patch that arkshine said sounds more efficient, I'd recommend you look into that.
__________________
Hunter-Digital is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-28-2011 , 11:34   Re: Proper Friendly Fire
Reply With Quote #4

Ok thanks guys I'll look into both these options
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 10:52.


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