Raised This Month: $ Target: $400
 0% 

Teamattack offset


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 05-06-2014 , 18:52   Teamattack offset
Reply With Quote #1

Hey guys Does anyone know offset for team attack? I need to set every attack as team attack, to do reduced damage. I've searched in https://forums.alliedmods.net/archiv...p/t-68113.html but nothing useful.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 05-06-2014 , 19:55   Re: Teamattack offset
Reply With Quote #2

For doing such thing you set attacker's team = victim's team, there' no other way (just looked at some half decompiled code)
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
TehKonijn
Junior Member
Join Date: May 2014
Old 05-06-2014 , 20:17   Re: Teamattack offset
Reply With Quote #3

Quote:
Originally Posted by GuskiS View Post
Hey guys Does anyone know offset for team attack? I need to set every attack as team attack, to do reduced damage. I've searched in https://forums.alliedmods.net/archiv...p/t-68113.html but nothing useful.
Funny, I was just doing some testing of my own to try and find the offset (incidentally to also implement it into the TTT plugin you released).

Quote:
Originally Posted by meTaLiCroSS View Post
For doing such thing you set attacker's team = victim's team, there' no other way (just looked at some half decompiled code)
How do you do this?
TehKonijn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-06-2014 , 20:23   Re: Teamattack offset
Reply With Quote #4

Quote:
Originally Posted by TehKonijn View Post
How do you do this?
get_user_team()
__________________
fysiks is offline
TehKonijn
Junior Member
Join Date: May 2014
Old 05-06-2014 , 20:27   Re: Teamattack offset
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
get_user_team()
This will only return the current team of the attacker. I & OP want to either:

1) Make team attacks deal the same damage as normal attacks
2) Make normal attacks deal the same damage as team attacks

I've tested team damage and it doesn't seem constant. Slashes in the foot deal 0.27 times reduced damage and slashes in the head deal 0.35
TehKonijn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-06-2014 , 20:36   Re: Teamattack offset
Reply With Quote #6

I guess I misunderstood the topic. I see what he is asking now. This seems bizarre to me that there would be a difference between enemy attacks and team attacks, maybe it's a CS thing.
__________________
fysiks is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 05-06-2014 , 21:16   Re: Teamattack offset
Reply With Quote #7

In the middle of CBasePlayer::TakeDamage

PHP Code:
    if ( pevAttacker->m_iTeam == this->m_iTeam )
      
flDamage *= 0.35
So you can guess everything with this...
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 05-06-2014 , 23:47   Re: Teamattack offset
Reply With Quote #8

sweet, now I exact damage reducement. Cause I didn't find offset, I was reducing myself by 0.33, but it wasn't precise. Than you meTaLiCroSS.
TehKonijn, actually it was working just fine in early releases, but after changing how round ends(from fake bot, to actuall player killing and round terminating) I forgot about this and just yesterday thought of this.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS 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 09:39.


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