AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Teamattack offset (https://forums.alliedmods.net/showthread.php?t=239988)

GuskiS 05-06-2014 18:52

Teamattack offset
 
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.

meTaLiCroSS 05-06-2014 19:55

Re: Teamattack offset
 
For doing such thing you set attacker's team = victim's team, there' no other way (just looked at some half decompiled code)

TehKonijn 05-06-2014 20:17

Re: Teamattack offset
 
Quote:

Originally Posted by GuskiS (Post 2134642)
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 (Post 2134651)
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?

fysiks 05-06-2014 20:23

Re: Teamattack offset
 
Quote:

Originally Posted by TehKonijn (Post 2134657)
How do you do this?

get_user_team()

TehKonijn 05-06-2014 20:27

Re: Teamattack offset
 
Quote:

Originally Posted by fysiks (Post 2134658)
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

fysiks 05-06-2014 20:36

Re: Teamattack offset
 
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.

meTaLiCroSS 05-06-2014 21:16

Re: Teamattack offset
 
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...

GuskiS 05-06-2014 23:47

Re: Teamattack offset
 
:o 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. :D


All times are GMT -4. The time now is 09:39.

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